39 Q_PROPERTY(
int pointId READ pointId NOTIFY pointIdChanged)
40 Q_PROPERTY(QPointingDeviceUniqueId uniqueId READ uniqueId NOTIFY uniqueIdChanged REVISION(2, 9))
41 Q_PROPERTY(
bool pressed READ pressed NOTIFY pressedChanged)
42 Q_PROPERTY(qreal x READ x NOTIFY xChanged)
43 Q_PROPERTY(qreal y READ y NOTIFY yChanged)
44 Q_PROPERTY(QSizeF ellipseDiameters READ ellipseDiameters NOTIFY ellipseDiametersChanged REVISION(2, 9))
45 Q_PROPERTY(qreal pressure READ pressure NOTIFY pressureChanged)
46 Q_PROPERTY(qreal rotation READ rotation NOTIFY rotationChanged REVISION(2, 9))
47 Q_PROPERTY(QVector2D velocity READ velocity NOTIFY velocityChanged)
48 Q_PROPERTY(QRectF area READ area NOTIFY areaChanged)
50 Q_PROPERTY(qreal startX READ startX NOTIFY startXChanged)
51 Q_PROPERTY(qreal startY READ startY NOTIFY startYChanged)
52 Q_PROPERTY(qreal previousX READ previousX NOTIFY previousXChanged)
53 Q_PROPERTY(qreal previousY READ previousY NOTIFY previousYChanged)
54 Q_PROPERTY(qreal sceneX READ sceneX NOTIFY sceneXChanged)
55 Q_PROPERTY(qreal sceneY READ sceneY NOTIFY sceneYChanged)
56 QML_NAMED_ELEMENT(TouchPoint)
57 QML_ADDED_IN_VERSION(2, 0)
60 QQuickTouchPoint(
bool qmlDefined =
true)
61 : _qmlDefined(qmlDefined)
64 int pointId()
const {
return _id; }
65 void setPointId(
int id);
67 QPointingDeviceUniqueId uniqueId()
const {
return _uniqueId; }
68 void setUniqueId(
const QPointingDeviceUniqueId &id);
70 qreal x()
const {
return _x; }
71 qreal y()
const {
return _y; }
72 void setPosition(QPointF pos);
74 QSizeF ellipseDiameters()
const {
return _ellipseDiameters; }
75 void setEllipseDiameters(
const QSizeF &d);
77 qreal pressure()
const {
return _pressure; }
78 void setPressure(qreal pressure);
80 qreal rotation()
const {
return _rotation; }
81 void setRotation(qreal r);
83 QVector2D velocity()
const {
return _velocity; }
84 void setVelocity(
const QVector2D &velocity);
86 QRectF area()
const {
return _area; }
87 void setArea(
const QRectF &area);
89 bool isQmlDefined()
const {
return _qmlDefined; }
91 bool inUse()
const {
return _inUse; }
92 void setInUse(
bool inUse) { _inUse = inUse; }
94 bool pressed()
const {
return _pressed; }
95 void setPressed(
bool pressed);
97 qreal startX()
const {
return _startX; }
98 void setStartX(qreal startX);
100 qreal startY()
const {
return _startY; }
101 void setStartY(qreal startY);
103 qreal previousX()
const {
return _previousX; }
104 void setPreviousX(qreal previousX);
106 qreal previousY()
const {
return _previousY; }
107 void setPreviousY(qreal previousY);
109 qreal sceneX()
const {
return _sceneX; }
110 void setSceneX(qreal sceneX);
112 qreal sceneY()
const {
return _sceneY; }
113 void setSceneY(qreal sceneY);
116 void pressedChanged();
117 void pointIdChanged();
118 Q_REVISION(2, 9)
void uniqueIdChanged();
121 Q_REVISION(2, 9)
void ellipseDiametersChanged();
122 void pressureChanged();
123 Q_REVISION(2, 9)
void rotationChanged();
124 void velocityChanged();
126 void startXChanged();
127 void startYChanged();
128 void previousXChanged();
129 void previousYChanged();
130 void sceneXChanged();
131 void sceneYChanged();
134 friend class QQuickMultiPointTouchArea;
138 qreal _pressure = 0.0;
140 QSizeF _ellipseDiameters;
145 bool _pressed =
false;
148 qreal _previousX = 0.0;
149 qreal _previousY = 0.0;
152 QPointingDeviceUniqueId _uniqueId;
185 Q_DISABLE_COPY_MOVE(QQuickMultiPointTouchArea)
187 Q_PROPERTY(QQmlListProperty<QQuickTouchPoint> touchPoints READ touchPoints CONSTANT)
188 Q_PROPERTY(
int minimumTouchPoints READ minimumTouchPoints WRITE setMinimumTouchPoints NOTIFY minimumTouchPointsChanged)
189 Q_PROPERTY(
int maximumTouchPoints READ maximumTouchPoints WRITE setMaximumTouchPoints NOTIFY maximumTouchPointsChanged)
190 Q_PROPERTY(
bool mouseEnabled READ mouseEnabled WRITE setMouseEnabled NOTIFY mouseEnabledChanged)
191 QML_NAMED_ELEMENT(MultiPointTouchArea)
192 QML_ADDED_IN_VERSION(2, 0)
195 QQuickMultiPointTouchArea(QQuickItem *parent=
nullptr);
196 ~QQuickMultiPointTouchArea();
198 int minimumTouchPoints()
const;
199 void setMinimumTouchPoints(
int num);
200 int maximumTouchPoints()
const;
201 void setMaximumTouchPoints(
int num);
202 bool mouseEnabled()
const {
return _mouseEnabled; }
203 void setMouseEnabled(
bool arg);
205 QQmlListProperty<QQuickTouchPoint> touchPoints() {
206 return QQmlListProperty<QQuickTouchPoint>(
this,
nullptr, QQuickMultiPointTouchArea::touchPoint_append, QQuickMultiPointTouchArea::touchPoint_count, QQuickMultiPointTouchArea::touchPoint_at,
nullptr);
209 static void touchPoint_append(QQmlListProperty<QQuickTouchPoint> *list, QQuickTouchPoint* touch) {
210 QQuickMultiPointTouchArea *q =
static_cast<QQuickMultiPointTouchArea*>(list->object);
211 q->addTouchPrototype(touch);
214 static qsizetype touchPoint_count(QQmlListProperty<QQuickTouchPoint> *list) {
215 QQuickMultiPointTouchArea *q =
static_cast<QQuickMultiPointTouchArea*>(list->object);
216 return q->_touchPrototypes.size();
219 static QQuickTouchPoint* touchPoint_at(QQmlListProperty<QQuickTouchPoint> *list, qsizetype index) {
220 QQuickMultiPointTouchArea *q =
static_cast<QQuickMultiPointTouchArea*>(list->object);
221 return q->_touchPrototypes.value(index);
225#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
226 void pressed(
const QList<QObject*> &touchPoints);
227 void updated(
const QList<QObject*> &touchPoints);
228 void released(
const QList<QObject*> &touchPoints);
229 void canceled(
const QList<QObject*> &touchPoints);
231 void pressed(
const QList<QObject*> &points);
232 void updated(
const QList<QObject*> &points);
233 void released(
const QList<QObject*> &points);
234 void canceled(
const QList<QObject*> &points);
236 void gestureStarted(QQuickGrabGestureEvent *gesture);
237#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
238 void touchUpdated(
const QList<QObject*> &touchPoints);
240 void touchUpdated(
const QList<QObject*> &points);
242 void minimumTouchPointsChanged();
243 void maximumTouchPointsChanged();
244 void mouseEnabledChanged();
247 void touchEvent(QTouchEvent *) override;
248 bool childMouseEventFilter(QQuickItem *receiver, QEvent *event) override;
249 void mousePressEvent(QMouseEvent *event) override;
250 void mouseReleaseEvent(QMouseEvent *event) override;
251 void mouseMoveEvent(QMouseEvent *event) override;
252 void mouseUngrabEvent() override;
253 void touchUngrabEvent() override;
255 void addTouchPrototype(QQuickTouchPoint* prototype);
256 void addTouchPoint(
const QEventPoint *p);
257 void addTouchPoint(
const QMouseEvent *e);
258 void clearTouchLists();
260 void updateTouchPoint(QQuickTouchPoint*,
const QEventPoint*);
261 void updateTouchPoint(QQuickTouchPoint *dtp,
const QMouseEvent *e);
262 enum class RemapEventPoints { No, ToLocal };
263 void updateTouchData(QEvent*, RemapEventPoints remap = RemapEventPoints::No);
265 bool sendMouseEvent(QMouseEvent *event);
266 bool shouldFilter(QEvent *event);
267 void grabGesture(QPointingDevice *dev);
268 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
270 void hoverEnterEvent(QHoverEvent *event) override;
271 void hoverLeaveEvent(QHoverEvent *event) override;
272 void setTouchEventsEnabled(
bool enable);
273 void itemChange(ItemChange change,
const ItemChangeData &data) override;
277 void ungrab(
bool normalRelease =
false);
278 QMap<
int,QQuickTouchPoint*> _touchPrototypes;
279 QMap<
int,QObject*> _touchPoints;
280 QList<QObject*> _releasedTouchPoints;
281 QList<QObject*> _pressedTouchPoints;
282 QList<QObject*> _movedTouchPoints;
283 int _minimumTouchPoints;
284 int _maximumTouchPoints;
285 QVector<
int> _lastFilterableTouchPointIds;
286 QPointer<QQuickTouchPoint> _mouseTouchPoint;
287 QEventPoint _mouseQpaTouchPoint;
288 const QPointingDevice *_touchMouseDevice;
\qmltype TextDocument \nativetype QQuickTextDocument \inqmlmodule QtQuick
#define QQuickTextInterface_iid