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.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 3c6f35bb6d..c2dac71e0d 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
}
/*!
@@ -2706,10 +2705,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.
@@ -2724,27 +2719,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
@@ -3346,18 +3334,18 @@ QWhatsThisClickedEvent::~QWhatsThisClickedEvent()
/*!
\class QActionEvent
\brief The QActionEvent class provides an event that is generated
- when a QAction is added, removed, or changed.
+ when a QGuiAction is added, removed, or changed.
\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.
- \sa QAction, QWidget::addAction(), QWidget::removeAction(), QWidget::actions()
+ \sa QGuiAction, QWidget::addAction(), QWidget::removeAction(), QWidget::actions()
*/
/*!
@@ -3368,7 +3356,7 @@ QWhatsThisClickedEvent::~QWhatsThisClickedEvent()
type is ActionAdded, the action is to be inserted before the
action \a before. If \a before is \nullptr, the action is appended.
*/
-QActionEvent::QActionEvent(int type, QAction *action, QAction *before)
+QActionEvent::QActionEvent(int type, QGuiAction *action, QGuiAction *before)
: QEvent(static_cast<QEvent::Type>(type)), act(action), bef(before)
{}
@@ -3603,7 +3591,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,
@@ -3624,7 +3612,7 @@ QShortcutEvent::~QShortcutEvent()
{
}
-#endif // QT_NO_SHORTCUT
+#endif // QT_CONFIG(shortcut)
#ifndef QT_NO_DEBUG_STREAM
@@ -3978,7 +3966,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();