summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r--src/gui/kernel/qevent.cpp108
1 files changed, 13 insertions, 95 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 466e70db30..dc49d8b324 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1235,7 +1235,7 @@ Qt::KeyboardModifiers QKeyEvent::modifiers() const
return QInputEvent::modifiers();
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
/*!
\fn bool QKeyEvent::matches(QKeySequence::StandardKey key) const
\since 4.2
@@ -1251,7 +1251,7 @@ bool QKeyEvent::matches(QKeySequence::StandardKey matchKey) const
const QList<QKeySequence> bindings = QKeySequence::keyBindings(matchKey);
return bindings.contains(QKeySequence(searchkey));
}
-#endif // QT_NO_SHORTCUT
+#endif // QT_CONFIG(shortcut)
/*!
@@ -2063,7 +2063,6 @@ QInputMethodEvent::QInputMethodEvent(const QInputMethodEvent &other)
QInputMethodEvent::~QInputMethodEvent()
{
- // must be empty until ### Qt 6
}
/*!
@@ -2292,7 +2291,6 @@ QVariant QInputMethodQueryEvent::value(Qt::InputMethodQuery query) const
\value FourDMouse A 4D Mouse.
\value RotationStylus A special stylus that also knows about rotation
(a 6D stylus). \since 4.1
- \omitvalue XFreeEraser
*/
/*!
@@ -2369,52 +2367,6 @@ QTabletEvent::QTabletEvent(Type type, const QPointF &pos, const QPointF &globalP
{
}
-#if QT_DEPRECATED_SINCE(5, 15)
-/*!
- Construct a tablet event of the given \a type.
-
- The \a pos parameter indicates where the event occurred in the
- widget; \a globalPos is the corresponding position in absolute
- coordinates.
-
- \a pressure contains the pressure exerted on the \a device.
-
- \a pointerType describes the type of pen that is being used.
-
- \a xTilt and \a yTilt contain the device's degree of tilt from the
- x and y axes respectively.
-
- \a keyState specifies which keyboard modifiers are pressed (e.g.,
- \uicontrol{Ctrl}).
-
- The \a uniqueID parameter contains the unique ID for the current device.
-
- The \a z parameter contains the coordinate of the device on the tablet, this
- is usually given by a wheel on 4D mouse. If the device does not support a
- Z-axis, pass zero here.
-
- The \a tangentialPressure parameter contins the tangential pressure of an air
- brush. If the device does not support tangential pressure, pass 0 here.
-
- \a rotation contains the device's rotation in degrees. 4D mice support
- rotation. If the device does not support rotation, pass 0 here.
-
- \sa pos(), globalPos(), device(), pressure(), xTilt(), yTilt(), uniqueId(), rotation(),
- tangentialPressure(), z()
-
- \deprecated in 5.4: use the constructor with MouseButton status
-*/
-
-QTabletEvent::QTabletEvent(Type type, 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)
- : QTabletEvent(type, pos, globalPos, device, pointerType, pressure, xTilt, yTilt,
- tangentialPressure, rotation, z, keyState, uniqueID, Qt::NoButton, Qt::NoButton)
-{
-}
-#endif
-
/*!
\internal
*/
@@ -2452,12 +2404,6 @@ Qt::MouseButtons QTabletEvent::buttons() const
}
/*!
- \fn TabletDevices QTabletEvent::device() const
-
- \deprecated Use deviceType().
-*/
-
-/*!
\fn TabletDevices QTabletEvent::deviceType() const
Returns the type of device that generated the event.
@@ -2585,7 +2531,7 @@ Qt::MouseButtons QTabletEvent::buttons() const
Returns the global x position of the mouse pointer at the time of
the event.
- \sa globalY(), globalPos(), hiResGlobalX()
+ \sa globalY(), globalPos()
*/
/*!
@@ -2594,7 +2540,7 @@ Qt::MouseButtons QTabletEvent::buttons() const
Returns the global y position of the tablet device at the time of
the event.
- \sa globalX(), globalPos(), hiResGlobalY()
+ \sa globalX(), globalPos()
*/
/*!
@@ -2621,22 +2567,6 @@ Qt::MouseButtons QTabletEvent::buttons() const
*/
/*!
- \fn qreal &QTabletEvent::hiResGlobalX() const
-
- The high precision x position of the tablet device.
-
- \obsolete use globalPosF()
-*/
-
-/*!
- \fn qreal &QTabletEvent::hiResGlobalY() const
-
- The high precision y position of the tablet device.
-
- \obsolete use globalPosF()
-*/
-
-/*!
\fn const QPointF &QTabletEvent::posF() const
Returns the position of the device, relative to the widget that
@@ -2718,10 +2648,6 @@ QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPoin
{ }
#endif
-typedef QHash<const QNativeGestureEvent*, const QTouchDevice*> NativeGestureEventDataHash;
-// ### Qt6: move this to a member in QNativeGestureEvent
-Q_GLOBAL_STATIC(NativeGestureEventDataHash, g_nativeGestureEventDataHash)
-
/*!
Constructs a native gesture event of type \a type originating from \a device.
@@ -2736,27 +2662,20 @@ QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QTouc
const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue)
: QInputEvent(QEvent::NativeGesture), mGestureType(type),
mLocalPos(localPos), mWindowPos(windowPos), mScreenPos(screenPos), mRealValue(realValue),
- mSequenceId(sequenceId), mIntValue(intValue)
+ mSequenceId(sequenceId), mIntValue(intValue), mDevice(device)
{
- g_nativeGestureEventDataHash->insert(this, device);
}
QNativeGestureEvent::~QNativeGestureEvent()
-{
- g_nativeGestureEventDataHash->remove(this);
-}
+ = default;
/*!
+ \fn const QTouchDevice *QNativeGestureEvent::device() const
\since 5.10
Returns the device.
*/
-const QTouchDevice *QNativeGestureEvent::device() const
-{
- return g_nativeGestureEventDataHash->value(this);
-}
-
/*!
\fn QNativeGestureEvent::gestureType() const
\since 5.2
@@ -3363,8 +3282,8 @@ QWhatsThisClickedEvent::~QWhatsThisClickedEvent()
\ingroup events
\inmodule QtGui
- Actions can be added to widgets using QWidget::addAction(). This
- generates an \l ActionAdded event, which you can handle to provide
+ Actions can be added to controls, for example by using QWidget::addAction().
+ This generates an \l ActionAdded event, which you can handle to provide
custom behavior. For example, QToolBar reimplements
QWidget::actionEvent() to create \l{QToolButton}s for the
actions.
@@ -3615,7 +3534,7 @@ QToolBarChangeEvent::~QToolBarChangeEvent()
#endif // QT_NO_TOOLBAR
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
/*!
Constructs a shortcut event for the given \a key press,
@@ -3636,7 +3555,7 @@ QShortcutEvent::~QShortcutEvent()
{
}
-#endif // QT_NO_SHORTCUT
+#endif // QT_CONFIG(shortcut)
#ifndef QT_NO_DEBUG_STREAM
@@ -3990,7 +3909,7 @@ QT_WARNING_POP
dbg << ')';
}
break;
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
case QEvent::Shortcut: {
const QShortcutEvent *se = static_cast<const QShortcutEvent *>(e);
dbg << "QShortcutEvent(" << se->key().toString() << ", id=" << se->shortcutId();
@@ -5014,9 +4933,8 @@ void QTouchEvent::TouchPoint::setFlags(InfoFlags flags)
The \a startPos is the position of a touch or mouse event that started the scrolling.
*/
QScrollPrepareEvent::QScrollPrepareEvent(const QPointF &startPos)
- : QEvent(QEvent::ScrollPrepare), m_target(nullptr), m_startPos(startPos)
+ : QEvent(QEvent::ScrollPrepare), m_startPos(startPos)
{
- Q_UNUSED(m_target);
}
/*!