Migrate QWindowSystemInterface to use QElapsedTimer

Change-Id: I7dfb0590dce79678d49f5d6ef8f60758719bcf72
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Laszlo Agocs 2012-03-09 14:26:43 +02:00 committed by Qt by Nokia
parent 12c8909883
commit 6a0f84e0a8
3 changed files with 5 additions and 6 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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);
};