Go to the documentation of this file.
10#include <QtCore/QObject>
11#include <QtCore/QCoreApplication>
24 template<
typename... Args>
38 class EventFilter:
public QObject
47 bool eventFilter(QObject* sourcePtr, QEvent* eventPtr);
53 EventFilter m_eventFilter;
54 bool m_isFilterInstalled;
61template<
typename... Args>
65 m_isFilterInstalled(false)
73 QCoreApplication* applicationPtr = QCoreApplication::instance();
74 if (applicationPtr !=
nullptr){
75 if (enableLocalization){
76 if (!m_isFilterInstalled){
77 applicationPtr->installEventFilter(&m_eventFilter);
79 m_isFilterInstalled =
true;
83 if (m_isFilterInstalled){
84 applicationPtr->removeEventFilter(&m_eventFilter);
86 m_isFilterInstalled =
false;
121bool TVisualChangesHandlerWrap<Base>::EventFilter::eventFilter(QObject* sourcePtr, QEvent* eventPtr)
123 if (sourcePtr == QCoreApplication::instance()){
124 switch (eventPtr->type()){
125 case QEvent::QEvent::ApplicationPaletteChange:
129 case QEvent::QEvent::LanguageChange:
138 return BaseClass::eventFilter(sourcePtr, eventPtr);
virtual void OnDesignSchemaChanged()
virtual void EnableVisualChangesHandler(bool enableLocalization=true)
If enabled, listen to the language change event from the application context.
virtual void OnLanguageChanged()
TVisualChangesHandlerWrap(Args &&... args)
Base class for component implementation.
This namespace contains standard classes based on Qt.
© Witold Gantzke and Kirill Lepskiy