From 6a0f84e0a86b9c27a861e19b4eb7bb4701a1e3c7 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 9 Mar 2012 14:26:43 +0200 Subject: Migrate QWindowSystemInterface to use QElapsedTimer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7dfb0590dce79678d49f5d6ef8f60758719bcf72 Reviewed-by: Samuel Rødal --- src/gui/kernel/qguiapplication.cpp | 2 ++ src/gui/kernel/qwindowsysteminterface_qpa.cpp | 6 +----- 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 QT_BEGIN_HEADER @@ -272,7 +273,7 @@ public: static WindowSystemEvent * getWindowSystemEvent(); static void queueWindowSystemEvent(WindowSystemEvent *ev); - static QTime eventTime; + static QElapsedTimer eventTime; static QList convertTouchPoints(const QList &points, QEvent::Type *type); }; -- cgit v1.2.3