summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp4
-rw-r--r--src/gui/kernel/qapplication_p.h2
-rw-r--r--src/gui/kernel/qapplication_win.cpp51
4 files changed, 23 insertions, 38 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 2f6c4e1..a92e38c 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5693,7 +5693,9 @@ void QGraphicsScenePrivate::updateTouchPointsForItem(QGraphicsItem *item,
touchPoint.setPos(item->d_ptr->genericMapFromScene(touchPoint.scenePos(), touchEvent->widget()));
touchPoint.setStartPos(item->d_ptr->genericMapFromScene(touchPoint.startScenePos(), touchEvent->widget()));
touchPoint.setLastPos(item->d_ptr->genericMapFromScene(touchPoint.lastScenePos(), touchEvent->widget()));
-#warning FIXME
+#ifdef Q_CC_GNU
+# warning FIXME
+#endif
// ### touchPoint.setSize(item->d_ptr->genericMapFromScene(touchPoint.sceneSize(), touchEvent->widget()));
}
touchEvent->setTouchPoints(touchPoints);
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index da1837c..e874071 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -314,7 +314,9 @@ void QGraphicsViewPrivate::convertTouchEventToGraphicsSceneTouchEvent(QGraphicsV
touchPoint.setScenePos(d->mapToScene(touchPoint.pos()));
touchPoint.setStartScenePos(d->mapToScene(touchPoint.startPos()));
touchPoint.setLastScenePos(d->mapToScene(touchPoint.lastPos()));
-#warning FIXME
+#ifdef Q_CC_GNU
+# warning FIXME
+#endif
// ### touchPoint.setSceneSize(d->mapToScene(touchPoint.screenSize()));
// screenPos, startScreenPos, lastScreenPos, and screenSize are already set from the
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index d34d4fe..60796fc 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -453,7 +453,7 @@ public:
static qt_CloseTouchInputHandlePtr CloseTouchInputHandle;
QHash<DWORD, int> touchInputIDToTouchPointID;
- QVector<QTouchEvent::TouchPoint *> appAllTouchPoints;
+ QList<QTouchEvent::TouchPoint> appAllTouchPoints;
bool translateTouchEvent(const MSG &msg);
#endif
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 1261a20..4bbec96 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3990,13 +3990,10 @@ void QApplicationPrivate::initializeMultitouch_sys()
CloseTouchInputHandle = static_cast<qt_CloseTouchInputHandlePtr>(library.resolve("CloseTouchInputHandle"));
touchInputIDToTouchPointID.clear();
- appAllTouchPoints.clear();
}
void QApplicationPrivate::cleanupMultitouch_sys()
{
- qDeleteAll(appAllTouchPoints);
- appAllTouchPoints.clear();
touchInputIDToTouchPointID.clear();
}
@@ -4008,8 +4005,7 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg)
if (!widgetForHwnd)
return false;
- Qt::TouchPointStates states = 0;
- QList<QTouchEvent::TouchPoint *> touchPoints;
+ QList<QTouchEvent::TouchPoint> touchPoints;
QVector<TOUCHINPUT> winTouchInputs(msg.wParam);
memset(winTouchInputs.data(), 0, sizeof(TOUCHINPUT) * winTouchInputs.count());
@@ -4023,55 +4019,40 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg)
touchInputIDToTouchPointID.insert(touchInput.dwID, touchPointID);
}
- if (appAllTouchPoints.count() <= touchPointID)
- appAllTouchPoints.resize(touchPointID + 1);
-
- QTouchEvent::TouchPoint *touchPoint = appAllTouchPoints.at(touchPointID);
- if (!touchPoint)
- touchPoint = appAllTouchPoints[touchPointID] = new QTouchEvent::TouchPoint(touchPointID);
+ QTouchEvent::TouchPoint touchPoint(touchPointID);
// update state
- bool down = touchPoint->state() != Qt::TouchPointReleased;
- QPointF screenPos(qreal(touchInput.x) / qreal(100.), qreal(touchInput.y) / qreal(100.));
+ bool down = touchPoint.state() != Qt::TouchPointReleased;
+ QPointF globalPos(qreal(touchInput.x) / qreal(100.), qreal(touchInput.y) / qreal(100.));
QSizeF contactArea = (touchInput.dwMask & TOUCHINPUTMASKF_CONTACTAREA)
? QSizeF(qreal(touchInput.cxContact) / qreal(100.),
qreal(touchInput.cyContact) / qreal(100.))
: QSizeF();
if (!down && (touchInput.dwFlags & TOUCHEVENTF_DOWN)) {
- touchPoint->setState(Qt::TouchPointPressed);
- touchPoint->setScreenPos(screenPos);
- touchPoint->setStartScreenPos(screenPos);
- touchPoint->setLastScreenPos(screenPos);
- touchPoint->setArea(contactArea);
- touchPoint->setPressure(qreal(1.));
+ touchPoint.setState(Qt::TouchPointPressed);
+ touchPoint.setGlobalPos(globalPos);
+ touchPoint.setSize(contactArea);
} else if (down && (touchInput.dwFlags & TOUCHEVENTF_UP)) {
- touchPoint->setState(Qt::TouchPointReleased);
- touchPoint->setLastScreenPos(touchPoint->screenPos());
- touchPoint->setScreenPos(screenPos);
- touchPoint->setArea(QSizeF());
- touchPoint->setPressure(qreal(0.));
+ touchPoint.setState(Qt::TouchPointReleased);
+ touchPoint.setGlobalPos(globalPos);
+ touchPoint.setSize(QSizeF());
} else if (down) {
- touchPoint->setState(screenPos == touchPoint->screenPos()
+ touchPoint.setState(globalPos == touchPoint.globalPos()
? Qt::TouchPointStationary
: Qt::TouchPointMoved);
- touchPoint->setLastScreenPos(touchPoint->screenPos());
- touchPoint->setScreenPos(screenPos);
- touchPoint->setArea(contactArea);
+ touchPoint.setGlobalPos(globalPos);
+ touchPoint.setSize(contactArea);
// pressure should still be 1.
}
- states |= touchPoint->state();
touchPoints.append(touchPoint);
}
QApplicationPrivate::CloseTouchInputHandle((HANDLE) msg.lParam);
- QTouchEvent touchEvent(QEvent::RawTouch,
- q->keyboardModifiers(),
- states,
- touchPoints);
- return qt_tabletChokeMouse = (QApplication::sendSpontaneousEvent(widgetForHwnd, &touchEvent)
- && touchEvent.isAccepted());
+ extern bool qt_translateRawTouchEvent(const QList<QTouchEvent::TouchPoint> &, QWidget *);
+ qt_tabletChokeMouse = qt_translateRawTouchEvent(touchPoints, widgetForHwnd);
+ return qt_tabletChokeMouse;
}
QT_END_NAMESPACE