diff options
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 570212966f..a062331bd8 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -40,6 +40,7 @@ #ifndef QEVENT_H #define QEVENT_H +#include <QtGui/qtguiglobal.h> #include <QtGui/qwindowdefs.h> #include <QtGui/qregion.h> #include <QtCore/qnamespace.h> @@ -51,7 +52,7 @@ #include <QtCore/qvector.h> #include <QtCore/qset.h> // ### Qt 6: Remove #include <QtCore/qurl.h> -#include <QtCore/qfile.h> // ### Qt 6: Replace by <qiodevice.h> and forward declare QFile +#include <QtCore/qfile.h> // ### Qt 6: Replace by <QtCore/qiodevice.h> and forward declare QFile #include <QtGui/qvector2d.h> #include <QtGui/qtouchdevice.h> // ### Qt 6: Replace by forward declaration @@ -131,6 +132,8 @@ public: inline Qt::MouseButton button() const { return b; } inline Qt::MouseButtons buttons() const { return mouseState; } + inline void setLocalPos(const QPointF &localPosition) { l = localPosition; } + #if QT_DEPRECATED_SINCE(5, 0) QT_DEPRECATED inline QPointF posF() const { return l; } #endif @@ -535,8 +538,9 @@ public: class Attribute { public: Attribute(AttributeType typ, int s, int l, QVariant val) : type(typ), start(s), length(l), value(qMove(val)) {} - AttributeType type; + Attribute(AttributeType typ, int s, int l) : type(typ), start(s), length(l), value() {} + AttributeType type; int start; int length; QVariant value; @@ -789,6 +793,22 @@ inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);} #endif // QT_NO_SHORTCUT +class QPointerUniqueIdPrivate; +class Q_GUI_EXPORT QPointerUniqueId +{ + Q_GADGET + Q_PROPERTY(qint64 numeric READ numeric CONSTANT) +public: + explicit QPointerUniqueId(qint64 id = -1); + + qint64 numeric() const; + +private: + // TODO for TUIO 2, or any other type of complex token ID, a d-pointer can replace + // m_numericId without changing the size of this class. + qint64 m_numericId; +}; + class QTouchEventTouchPointPrivate; class Q_GUI_EXPORT QTouchEvent : public QInputEvent { @@ -797,7 +817,8 @@ public: { public: enum InfoFlag { - Pen = 0x0001 + Pen = 0x0001, + Token = 0x0002 }; #ifndef Q_MOC_RUN // otherwise moc gives @@ -823,6 +844,7 @@ public: { qSwap(d, other.d); } int id() const; + QPointerUniqueId uniqueId() const; Qt::TouchPointState state() const; @@ -847,12 +869,14 @@ public: QRectF screenRect() const; qreal pressure() const; + qreal rotation() const; QVector2D velocity() const; InfoFlags flags() const; QVector<QPointF> rawScreenPositions() const; // internal void setId(int id); + void setUniqueId(qint64 uid); void setState(Qt::TouchPointStates state); void setPos(const QPointF &pos); void setScenePos(const QPointF &scenePos); @@ -870,6 +894,7 @@ public: void setSceneRect(const QRectF &sceneRect); void setScreenRect(const QRectF &screenRect); void setPressure(qreal pressure); + void setRotation(qreal angle); void setVelocity(const QVector2D &v); void setFlags(InfoFlags flags); void setRawScreenPositions(const QVector<QPointF> &positions); |