summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-05-17 11:06:17 +0100
committerQt by Nokia <qt-info@nokia.com>2012-05-18 10:37:33 +0200
commita5972f8ec32631e70578c64e9d6c063b3c47f0f5 (patch)
tree74021d5c5cdf670910cfdcb0ba6f95c88e83afbd
parent276a86592a529eb0a1659764acaa4cf9f5e112a0 (diff)
Avoid qobject_cast
This is slightly faster, and also avoids accessing the object's meta object that would cause any lazily created meta objects from being built. Change-Id: I0a78e09511c120bdbe707a1efc91ba480ab7680c Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
-rw-r--r--src/gui/kernel/qguiapplication.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 03c28a7385..570f3f7f3f 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1007,7 +1007,8 @@ bool QGuiApplication::notify(QObject *object, QEvent *event)
}
#endif
- QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(qobject_cast<QWindow *>(object), event);
+ if (object->isWindowType())
+ QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
return QCoreApplication::notify(object, event);
}