diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-03-09 14:26:43 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-12 13:14:05 +0100 |
commit | 6a0f84e0a86b9c27a861e19b4eb7bb4701a1e3c7 (patch) | |
tree | c7f94a83dc8ad4cc2ef5e0798bf83c1e7308a7bd | |
parent | 12c89098832de7475ad6ad11fe92f50b13f713f4 (diff) |
Migrate QWindowSystemInterface to use QElapsedTimer
Change-Id: I7dfb0590dce79678d49f5d6ef8f60758719bcf72
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_qpa.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_qpa_p.h | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index bfc52a816c..26690c78cf 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -696,6 +696,8 @@ void QGuiApplicationPrivate::init() // trigger registering of QVariant's GUI types qRegisterGuiVariant(); + QWindowSystemInterfacePrivate::eventTime.start(); + is_app_running = true; init_plugins(pluginList); QWindowSystemInterface::sendWindowSystemEvents(QCoreApplicationPrivate::eventDispatcher, QEventLoop::AllEvents); diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index 6f0abbdd0c..be9ac8e545 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE -QTime QWindowSystemInterfacePrivate::eventTime; +QElapsedTimer QWindowSystemInterfacePrivate::eventTime; //------------------------------------------------------------ // @@ -266,10 +266,6 @@ void QWindowSystemInterfacePrivate::queueWindowSystemEvent(QWindowSystemInterfac windowSystemEventQueue.append(ev); queueMutex.unlock(); - // Make sure the event timer is started. - if (!QWindowSystemInterfacePrivate::eventTime.isValid()) - QWindowSystemInterfacePrivate::eventTime.start(); - QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::qt_qpa_core_dispatcher(); if (dispatcher) dispatcher->wakeUp(); diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h index f5c141b4c9..fe97b486ad 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h +++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h @@ -42,6 +42,7 @@ #define QWINDOWSYSTEMINTERFACE_QPA_P_H #include "qwindowsysteminterface_qpa.h" +#include <QElapsedTimer> QT_BEGIN_HEADER @@ -272,7 +273,7 @@ public: static WindowSystemEvent * getWindowSystemEvent(); static void queueWindowSystemEvent(WindowSystemEvent *ev); - static QTime eventTime; + static QElapsedTimer eventTime; static QList<QTouchEvent::TouchPoint> convertTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points, QEvent::Type *type); }; |