diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-30 09:33:03 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-30 09:33:03 (GMT) |
commit | 33a9b5b4c7945c800b6590b993c841fb833276e8 (patch) | |
tree | 137c98909c32de822150784ae786a6188ff30c9f | |
parent | cd260501918ea767e8a3ca33a51b1cb4e1bbd45c (diff) | |
download | Qt-33a9b5b4c7945c800b6590b993c841fb833276e8.zip Qt-33a9b5b4c7945c800b6590b993c841fb833276e8.tar.gz Qt-33a9b5b4c7945c800b6590b993c841fb833276e8.tar.bz2 |
Determine whether TouchBegin or TouchEnd should be sent at the time of touchpoint addition/removal
This will make it easier to change later when supporting touching multiple widgets
-rw-r--r-- | src/gui/kernel/qapplication_win.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 9b756a6..60bad92 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -4039,7 +4039,8 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg) { Q_Q(QApplication); - bool sendTouchBegin = currentTouchPoints.isEmpty(); + bool sendTouchBegin = false; + bool sendTouchEnd = false; QList<QTouchEvent::TouchPoint *> activeTouchPoints = currentTouchPoints; QVector<TOUCHINPUT> winTouchInputs(msg.wParam); @@ -4065,13 +4066,17 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg) bool down = touchPoint->d->state != Qt::TouchPointReleased; QPointF globalPos(qreal(touchInput.x) / qreal(100.), qreal(touchInput.y) / qreal(100.)); if (!down && (touchInput.dwFlags & TOUCHEVENTF_DOWN)) { + sendTouchBegin = currentTouchPoints.isEmpty(); insertActiveTouch(touchPoint); activeTouchPoints = currentTouchPoints; + touchPoint->d->state = Qt::TouchPointPressed; touchPoint->d->globalPos = touchPoint->d->startGlobalPos = touchPoint->d->lastGlobalPos = globalPos; touchPoint->d->pressure = qreal(1.); } else if (down && (touchInput.dwFlags & TOUCHEVENTF_UP)) { removeActiveTouch(touchPoint); + sendTouchEnd = currentTouchPoints.isEmpty(); + touchPoint->d->state = Qt::TouchPointReleased; touchPoint->d->lastGlobalPos = touchPoint->d->globalPos; touchPoint->d->globalPos = globalPos; @@ -4087,8 +4092,6 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg) } QApplicationPrivate::CloseTouchInputHandle((HANDLE) msg.lParam); - bool sendTouchEnd = currentTouchPoints.isEmpty(); - if (activeTouchPoints.isEmpty()) return false; |