summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r--src/gui/kernel/qevent.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index d70f6be201..a7dce43f72 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -713,9 +713,19 @@ public:
Q_DECLARE_FLAGS(InfoFlags, InfoFlag)
explicit TouchPoint(int id = -1);
- TouchPoint(const QTouchEvent::TouchPoint &other);
+ TouchPoint(const TouchPoint &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ TouchPoint(TouchPoint &&other) : d(other.d) { other.d = 0; }
+ TouchPoint &operator=(TouchPoint &&other)
+ { qSwap(d, other.d); return *this; }
+#endif
~TouchPoint();
+ TouchPoint &operator=(const TouchPoint &other)
+ { if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
+
+ void swap(TouchPoint &other) { qSwap(d, other.d); }
+
int id() const;
Qt::TouchPointState state() const;
@@ -743,7 +753,7 @@ public:
qreal pressure() const;
QVector2D velocity() const;
InfoFlags flags() const;
- QList<QPointF> rawScreenPositions() const;
+ QVector<QPointF> rawScreenPositions() const;
// internal
void setId(int id);
@@ -766,8 +776,7 @@ public:
void setPressure(qreal pressure);
void setVelocity(const QVector2D &v);
void setFlags(InfoFlags flags);
- void setRawScreenPositions(const QList<QPointF> &positions);
- QTouchEvent::TouchPoint &operator=(const QTouchEvent::TouchPoint &other);
+ void setRawScreenPositions(const QVector<QPointF> &positions);
private:
QTouchEventTouchPointPrivate *d;
@@ -819,7 +828,7 @@ protected:
friend class QApplication;
friend class QApplicationPrivate;
};
-
+Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE);
Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags)
class QScrollPrepareEventPrivate;