aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-08-03 15:32:42 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-08-04 04:44:23 +0000
commit5ef56c550cd01b7e7d1d0ecdb4a60ff9e9eb3e73 (patch)
tree552592ea3126a229fa79266569acbb57e8bb6990 /src/quick/items/qquickevents.cpp
parent1cd7f9bd3769f6aab9cd7aba12536b1e3fa532be (diff)
QQuickEvents: de-inline a few more functions
Touching this header results in rebuilding a lot of stuff, and these functions are likely to need further modification. Change-Id: Idc99255fc8e20a190c31b5e3d47dd005f4573434 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents.cpp')
-rw-r--r--src/quick/items/qquickevents.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index 69df946d6f..6f108162f7 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -501,6 +501,19 @@ QQuickPointerDevice *QQuickPointerDevice::tabletDevice(qint64 id)
return nullptr;
}
+void QQuickEventPoint::reset(Qt::TouchPointState state, QPointF scenePos, quint64 pointId, ulong timestamp)
+{
+ m_scenePos = scenePos;
+ m_pointId = pointId;
+ m_valid = true;
+ m_accept = false;
+ m_state = state;
+ m_timestamp = timestamp;
+ if (state == Qt::TouchPointPressed)
+ m_pressTimestamp = timestamp;
+ // TODO calculate velocity
+}
+
QQuickItem *QQuickEventPoint::grabber() const
{
return m_grabber.data();
@@ -511,10 +524,23 @@ void QQuickEventPoint::setGrabber(QQuickItem *grabber)
m_grabber = QPointer<QQuickItem>(grabber);
}
+void QQuickEventPoint::setAccepted(bool accepted)
+{
+ m_accept = accepted;
+}
+
QQuickEventTouchPoint::QQuickEventTouchPoint(QQuickPointerTouchEvent *parent)
: QQuickEventPoint(parent), m_rotation(0), m_pressure(0)
{}
+void QQuickEventTouchPoint::reset(const QTouchEvent::TouchPoint &tp, ulong timestamp)
+{
+ QQuickEventPoint::reset(tp.state(), tp.scenePos(), tp.id(), timestamp);
+ m_rotation = tp.rotation();
+ m_pressure = tp.pressure();
+ m_uniqueId = tp.uniqueId();
+}
+
/*!
\internal
\class QQuickPointerEvent