diff options
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 111 |
1 files changed, 28 insertions, 83 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index cf596d8d45..7d2d6dbdcc 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -41,29 +41,31 @@ #define QEVENT_H #include <QtGui/qtguiglobal.h> -#include <QtGui/qwindowdefs.h> -#include <QtGui/qregion.h> + +#include <QtCore/qcoreevent.h> +#include <QtCore/qiodevice.h> #include <QtCore/qnamespace.h> #include <QtCore/qstring.h> -#include <QtGui/qkeysequence.h> -#include <QtCore/qcoreevent.h> #include <QtCore/qvariant.h> -#include <QtCore/qmap.h> // ### Qt 6: Remove #include <QtCore/qvector.h> -#include <QtCore/qset.h> // ### Qt 6: Remove #include <QtCore/qurl.h> -#include <QtCore/qfile.h> // ### Qt 6: Replace by <QtCore/qiodevice.h> and forward declare QFile +#include <QtGui/qregion.h> #include <QtGui/qvector2d.h> -#include <QtGui/qtouchdevice.h> // ### Qt 6: Replace by forward declaration +#include <QtGui/qwindowdefs.h> -QT_BEGIN_NAMESPACE +#if QT_CONFIG(shortcut) +# include <QtGui/qkeysequence.h> +#endif +QT_BEGIN_NAMESPACE -class QAction; -#ifndef QT_NO_GESTURES +class QFile; +class QGuiAction; +class QScreen; +class QTouchDevice; +#if QT_CONFIG(gestures) class QGesture; #endif -class QScreen; class Q_GUI_EXPORT QInputEvent : public QEvent { @@ -134,10 +136,6 @@ public: inline void setLocalPos(const QPointF &localPosition) { l = localPosition; } -#if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED inline QPointF posF() const { return l; } -#endif - Qt::MouseEventSource source() const; Qt::MouseEventFlags flags() const; @@ -279,14 +277,6 @@ public: enum PointerType { UnknownPointer, Pen, Cursor, Eraser }; Q_ENUM(PointerType) -#if QT_DEPRECATED_SINCE(5, 15) - // Actually deprecated since 5.4, in docs - QT_DEPRECATED_VERSION_X_5_15("Use the other QTabletEvent constructor") - 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); // ### remove in Qt 6 -#endif 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, @@ -296,9 +286,6 @@ public: inline QPoint pos() const { return mPos.toPoint(); } inline QPoint globalPos() const { return mGPos.toPoint(); } -#if QT_DEPRECATED_SINCE(5,0) - QT_DEPRECATED inline const QPointF &hiResGlobalPos() const { return mPos; } -#endif inline const QPointF &posF() const { return mPos; } inline const QPointF &globalPosF() const { return mGPos; } @@ -307,14 +294,6 @@ public: inline int y() const { return qRound(mPos.y()); } inline int globalX() const { return qRound(mGPos.x()); } inline int globalY() const { return qRound(mGPos.y()); } -#if QT_DEPRECATED_SINCE(5, 15) - QT_DEPRECATED_VERSION_X_5_15("use globalPosF().x()") - inline qreal hiResGlobalX() const { return mGPos.x(); } - QT_DEPRECATED_VERSION_X_5_15("use globalPosF().y()") - inline qreal hiResGlobalY() const { return mGPos.y(); } - QT_DEPRECATED_VERSION_X_5_15("Use deviceType()") - inline TabletDevice device() const { return TabletDevice(mDev); } -#endif inline TabletDevice deviceType() const { return TabletDevice(mDev); } inline PointerType pointerType() const { return PointerType(mPointerType); } inline qint64 uniqueId() const { return mUnique; } @@ -339,7 +318,7 @@ protected: }; #endif // QT_CONFIG(tabletevent) -#ifndef QT_NO_GESTURES +#if QT_CONFIG(gestures) class Q_GUI_EXPORT QNativeGestureEvent : public QInputEvent { public: @@ -361,7 +340,7 @@ public: const QPointF &windowPos() const { return mWindowPos; } const QPointF &screenPos() const { return mScreenPos; } - const QTouchDevice *device() const; + const QTouchDevice *device() const { return mDevice; } protected: Qt::NativeGestureType mGestureType; @@ -371,8 +350,9 @@ protected: qreal mRealValue; ulong mSequenceId; quint64 mIntValue; + const QTouchDevice *mDevice; }; -#endif // QT_NO_GESTURES +#endif // QT_CONFIG(gestures) class Q_GUI_EXPORT QKeyEvent : public QInputEvent { @@ -385,7 +365,7 @@ public: ~QKeyEvent(); int key() const { return k; } -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) bool matches(QKeySequence::StandardKey key) const; #endif Qt::KeyboardModifiers modifiers() const; @@ -397,22 +377,6 @@ public: inline quint32 nativeVirtualKey() const { return nVirtualKey; } inline quint32 nativeModifiers() const { return nModifiers; } - // Functions for the extended key event information -#if QT_DEPRECATED_SINCE(5, 0) - static inline QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, - quint32 nativeScanCode, quint32 nativeVirtualKey, - quint32 nativeModifiers, - const QString& text = QString(), bool autorep = false, - ushort count = 1) - { - return new QKeyEvent(type, key, modifiers, - nativeScanCode, nativeVirtualKey, nativeModifiers, - text, autorep, count); - } - - inline bool hasExtendedInfo() const { return true; } -#endif - protected: QString txt; int k; @@ -761,18 +725,18 @@ private: }; #endif -#ifndef QT_NO_ACTION +#if QT_CONFIG(action) class Q_GUI_EXPORT QActionEvent : public QEvent { - QAction *act, *bef; + QGuiAction *act, *bef; public: - QActionEvent(int type, QAction *action, QAction *before = nullptr); + QActionEvent(int type, QGuiAction *action, QGuiAction *before = nullptr); ~QActionEvent(); - inline QAction *action() const { return act; } - inline QAction *before() const { return bef; } + inline QGuiAction *action() const { return act; } + inline QGuiAction *before() const { return bef; } }; -#endif +#endif // QT_CONFIG(action) class Q_GUI_EXPORT QFileOpenEvent : public QEvent { @@ -802,7 +766,7 @@ private: }; #endif -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) class Q_GUI_EXPORT QShortcutEvent : public QEvent { public: @@ -837,10 +801,10 @@ private: Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *); #endif -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);} inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);} -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) class Q_GUI_EXPORT QPointingDeviceUniqueId { @@ -865,14 +829,6 @@ private: }; Q_DECLARE_TYPEINFO(QPointingDeviceUniqueId, Q_MOVABLE_TYPE); -#if 0 -#pragma qt_sync_suspend_processing -#endif -template <> class QList<QPointingDeviceUniqueId> {}; // to prevent instantiation: use QVector instead -#if 0 -#pragma qt_sync_resume_processing -#endif - Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept; inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept { return !operator==(lhs, rhs); } @@ -981,13 +937,6 @@ public: friend class QQuickMultiPointTouchArea; }; -#if QT_DEPRECATED_SINCE(5, 0) - enum DeviceType { - TouchScreen, - TouchPad - }; -#endif - explicit QTouchEvent(QEvent::Type eventType, QTouchDevice *device = nullptr, Qt::KeyboardModifiers modifiers = Qt::NoModifier, @@ -997,9 +946,6 @@ public: inline QWindow *window() const { return _window; } inline QObject *target() const { return _target; } -#if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED inline QTouchEvent::DeviceType deviceType() const { return static_cast<DeviceType>(int(_device->type())); } -#endif inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; } inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; } inline QTouchDevice *device() const { return _device; } @@ -1050,7 +996,6 @@ public: void setContentPos(const QPointF &pos); private: - QObject* m_target; // Qt 6 remove. QPointF m_startPos; QSizeF m_viewportSize; QRectF m_contentPosRange; |