diff options
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 0a826284c9..d128c34134 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -223,6 +223,9 @@ protected: #ifndef QT_NO_TABLETEVENT class Q_GUI_EXPORT QTabletEvent : public QInputEvent { + Q_GADGET + Q_ENUMS(TabletDevice) + Q_ENUMS(PointerType) public: enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse, XFreeEraser /*internal*/, RotationStylus }; @@ -230,7 +233,12 @@ public: QTabletEvent(Type t, const QPointF &pos, const QPointF &globalPos, int device, int pointerType, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, - Qt::KeyboardModifiers keyState, qint64 uniqueID); + Qt::KeyboardModifiers keyState, qint64 uniqueID); // ### remove in Qt 6 + QTabletEvent(Type t, const QPointF &pos, const QPointF &globalPos, + int device, int pointerType, qreal pressure, int xTilt, int yTilt, + qreal tangentialPressure, qreal rotation, int z, + Qt::KeyboardModifiers keyState, qint64 uniqueID, + Qt::MouseButton button, Qt::MouseButtons buttons); ~QTabletEvent(); inline QPoint pos() const { return mPos.toPoint(); } @@ -257,6 +265,8 @@ public: inline qreal rotation() const { return mRot; } inline int xTilt() const { return mXT; } inline int yTilt() const { return mYT; } + Qt::MouseButton button() const; + Qt::MouseButtons buttons() const; protected: QPointF mPos, mGPos; @@ -264,9 +274,8 @@ protected: qreal mPress, mTangential, mRot; qint64 mUnique; - // I don't know what the future holds for tablets but there could be some - // new devices coming along, and there seem to be "holes" in the - // OS-specific events for this. + // QTabletEventPrivate for extra storage. + // ### Qt 6: QPointingEvent will have Buttons, QTabletEvent will inherit void *mExtra; }; #endif // QT_NO_TABLETEVENT @@ -377,8 +386,6 @@ public: inline const QRegion ®ion() const { return m_region; } protected: - friend class QApplication; - friend class QCoreApplication; QRect m_rect; QRegion m_region; bool m_erased; @@ -395,7 +402,6 @@ public: protected: QPoint p, oldp; friend class QApplication; - friend class QCoreApplication; }; class Q_GUI_EXPORT QExposeEvent : public QEvent @@ -421,7 +427,6 @@ public: protected: QSize s, olds; friend class QApplication; - friend class QCoreApplication; }; @@ -601,7 +606,6 @@ public: inline void ignore(const QRect & r) { ignore(); rect = r; } protected: - friend class QApplication; QRect rect; }; @@ -760,7 +764,11 @@ public: enum InfoFlag { Pen = 0x0001 }; +#ifndef Q_MOC_RUN + // otherwise moc gives + // Error: Meta object features not supported for nested classes Q_DECLARE_FLAGS(InfoFlags, InfoFlag) +#endif explicit TouchPoint(int id = -1); TouchPoint(const TouchPoint &other); @@ -881,6 +889,10 @@ protected: Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE); Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags) +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug, const QTouchEvent::TouchPoint &); +#endif + class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent { public: |