summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-05-04 10:22:44 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-05-04 10:22:44 (GMT)
commit36c97c3e530969d172179d715805804ffb96e792 (patch)
tree0eb0494d276afc068598fdec33dacc4d025f2b85
parentbdeefa6bd4b8721c737aeb63794034c3495be9a1 (diff)
downloadQt-36c97c3e530969d172179d715805804ffb96e792.zip
Qt-36c97c3e530969d172179d715805804ffb96e792.tar.gz
Qt-36c97c3e530969d172179d715805804ffb96e792.tar.bz2
Initialize activeTouchPoints in the loop itself instead of before
This will make it easier to make the change to sending touch events to multiple widgets.
-rw-r--r--src/gui/kernel/qapplication_win.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index b9262af..fbedd19 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -4049,8 +4049,7 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg)
return false;
QEvent::Type eventType = QEvent::None;
- QList<QTouchEvent::TouchPoint *> activeTouchPoints = currentTouchPoints;
-
+ QList<QTouchEvent::TouchPoint *> activeTouchPoints;
QVector<TOUCHINPUT> winTouchInputs(msg.wParam);
memset(winTouchInputs.data(), 0, sizeof(TOUCHINPUT) * winTouchInputs.count());
QApplicationPrivate::GetTouchInputInfo((HANDLE) msg.lParam, msg.wParam, winTouchInputs.data(), sizeof(TOUCHINPUT));
@@ -4082,6 +4081,7 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg)
touchPoint->d->globalPos = touchPoint->d->startGlobalPos = touchPoint->d->lastGlobalPos = globalPos;
touchPoint->d->pressure = qreal(1.);
} else if (down && (touchInput.dwFlags & TOUCHEVENTF_UP)) {
+ activeTouchPoints = currentTouchPoints;
eventType = removeActiveTouch(touchPoint);
touchPoint->d->state = Qt::TouchPointReleased;
@@ -4089,6 +4089,8 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg)
touchPoint->d->globalPos = globalPos;
touchPoint->d->pressure = qreal(0.);
} else if (down) {
+ if (activeTouchPoints.isEmpty())
+ activeTouchPoints = currentTouchPoints;
eventType = QEvent::TouchUpdate;
touchPoint->d->state = globalPos == touchPoint->d->globalPos
? Qt::TouchPointStationary