diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-07-31 11:57:08 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-01 00:14:41 +0200 |
commit | 39df773eb5926621d1a742ed5af574933028b2a8 (patch) | |
tree | 12454b35b0ba658e48bf5521b8a105fd991767f7 | |
parent | a0be8ef271bb77c54676625f6f1cbdaf29857196 (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 (e.g., for
QML) from being built.
This is just a port of commit a5972f8ec32631e70578c64e9d6c063b3c47f0f5
(which fixed QGuiApplication, but not QApplication).
Change-Id: I0d5080495aa4fd4486db297968c4d06bbfacf89b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index dc09155438..803d1efc0d 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2978,7 +2978,8 @@ bool QApplication::notify(QObject *receiver, QEvent *e) d->checkReceiverThread(receiver); #endif - QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(qobject_cast<QWindow *>(receiver), e); + if (receiver->isWindowType()) + QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(receiver), e); // capture the current mouse/keyboard state if(e->spontaneous()) { |