summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2014-09-01 14:53:14 +0200
committerMorten Johan Sørvig <morten.sorvig@digia.com>2014-09-15 10:29:25 +0200
commit1126701f8c459b92aee8a08befaf8e4ec216fd46 (patch)
treead0b9ca333b200cf8c40e56d736e79053d072417 /src/corelib/kernel/qcoreapplication.cpp
parentc8d2514347cedbd05f9e11822a9268f32e779dc3 (diff)
cocoa: don't override NSApplication-sendEvent if configured as AA_MacPluginApplication
Change-Id: I48cebbcb814ee8e97583c3165e7cb668077cfbad Task-number: QTBUG-40409 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp8
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;