diff options
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 6868eb6a1e..82c157ee7f 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2528,6 +2528,9 @@ void QCoreApplication::removeLibraryPath(const QString &path) \note The filter function set here receives native messages, i.e. MSG or XCB event structs. + \note Native event filters will be disabled when the application the + Qt::AA_MacPluginApplication attribute is set. + For maximum portability, you should always try to use QEvents and QObject::installEventFilter() whenever possible. @@ -2537,6 +2540,11 @@ void QCoreApplication::removeLibraryPath(const QString &path) */ void QCoreApplication::installNativeEventFilter(QAbstractNativeEventFilter *filterObj) { + if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) { + qWarning("Native event filters are not applied when the Qt::AA_MacPluginApplication attribute is set"); + return; + } + QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(QCoreApplicationPrivate::theMainThread); if (!filterObj || !eventDispatcher) return; |