From a3504361a19428c12ac7e044762f252d8ba2b26f Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 29 Apr 2009 18:08:44 +0200 Subject: Don't store activeTouchPoints in QApplicationPrivate it's only needed and updated during delivery, so the extra copy isn't necessary --- src/gui/kernel/qapplication_p.h | 2 +- src/gui/kernel/qapplication_win.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index ce7110d..da66aab 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -438,7 +438,7 @@ public: QMap touchInputIDToTouchPointID; QVector allTouchPoints; - QList currentTouchPoints, activeTouchPoints; + QList currentTouchPoints; void initializeMultitouch(); void insertActiveTouch(QTouchEvent::TouchPoint *touchPoint); diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index f1fb0a4..c7ecdae 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -4003,7 +4003,6 @@ void QApplicationPrivate::initializeMultitouch() touchInputIDToTouchPointID.clear(); allTouchPoints.clear(); currentTouchPoints.clear(); - activeTouchPoints.clear(); } void QApplicationPrivate::insertActiveTouch(QTouchEvent::TouchPoint *touchPoint) @@ -4015,7 +4014,6 @@ void QApplicationPrivate::insertActiveTouch(QTouchEvent::TouchPoint *touchPoint) break; } currentTouchPoints.insert(at, touchPoint); - activeTouchPoints = currentTouchPoints; if (currentTouchPoints.count() > allTouchPoints.count()) { qFatal("Qt: INTERNAL ERROR: currentTouchPoints.count() (%d) > allTouchPoints.count() (%d)", @@ -4042,7 +4040,7 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg) Q_Q(QApplication); bool sendTouchBegin = currentTouchPoints.isEmpty(); - activeTouchPoints = currentTouchPoints; + QList activeTouchPoints = currentTouchPoints; QVector winTouchInputs(msg.wParam); memset(winTouchInputs.data(), 0, sizeof(TOUCHINPUT) * winTouchInputs.count()); @@ -4068,6 +4066,7 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg) QPointF globalPos(qreal(touchInput.x) / qreal(100.), qreal(touchInput.y) / qreal(100.)); if (!down && (touchInput.dwFlags & TOUCHEVENTF_DOWN)) { insertActiveTouch(touchPoint); + activeTouchPoints = currentTouchPoints; touchPoint->d->state = Qt::TouchPointPressed; touchPoint->d->globalPos = touchPoint->d->startGlobalPos = touchPoint->d->lastGlobalPos = globalPos; touchPoint->d->pressure = qreal(1.); -- cgit v0.12