summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-11-09 15:53:49 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-11-10 16:53:31 +0100
commit9fa071d3fe419e4c5319c1af1a46c7cd4771b45f (patch)
tree94d8bc499174e49f8b8538a31f27720bf27518c9
parent2f71d9d837ad50428dc86ca80496b16b8140b2bf (diff)
Replace ushort -> quint16 in event classes
We used quint32 for 32-bit types and ushort for 16-bit ones, but using explicit bit sizes looks more consistent. Change-Id: I3106dd6ecb2367fef6f8012c28266e1b4b1abf4b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/corelib/kernel/qcoreevent.h16
-rw-r--r--src/gui/kernel/qevent.cpp4
-rw-r--r--src/gui/kernel/qevent.h8
3 files changed, 14 insertions, 14 deletions
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 32f2ba75c7..88262659e9 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -320,16 +320,16 @@ protected:
struct SinglePointEventTag { explicit SinglePointEventTag() = default; };
QEvent(Type type, SinglePointEventTag) : QEvent(type, PointerEventTag{}) { m_singlePointEvent = true; }
QEventPrivate *d;
- ushort t;
+ quint16 t;
private:
- ushort posted : 1;
- ushort spont : 1;
- ushort m_accept : 1;
- ushort m_inputEvent : 1;
- ushort m_pointerEvent : 1;
- ushort m_singlePointEvent : 1;
- ushort reserved : 10;
+ quint16 posted : 1;
+ quint16 spont : 1;
+ quint16 m_accept : 1;
+ quint16 m_inputEvent : 1;
+ quint16 m_pointerEvent : 1;
+ quint16 m_singlePointEvent : 1;
+ quint16 reserved : 10;
friend class QCoreApplication;
friend class QCoreApplicationPrivate;
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index d6a7fa79bc..91b387324a 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1309,7 +1309,7 @@ bool QWheelEvent::isEndEvent() const
in the event.
*/
QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text,
- bool autorep, ushort count)
+ bool autorep, quint16 count)
: QInputEvent(type, QInputDevice::primaryKeyboard(), modifiers), m_text(text), m_key(key),
m_scanCode(0), m_virtualKey(0), m_modifiers(0),
m_count(count), m_autoRepeat(autorep)
@@ -1338,7 +1338,7 @@ QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const
*/
QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
- const QString &text, bool autorep, ushort count, const QInputDevice *device)
+ const QString &text, bool autorep, quint16 count, const QInputDevice *device)
: QInputEvent(type, device, modifiers), m_text(text), m_key(key),
m_scanCode(nativeScanCode), m_virtualKey(nativeVirtualKey), m_modifiers(nativeModifiers),
m_count(count), m_autoRepeat(autorep)
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 7a361591e9..ce61b3a34f 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -406,10 +406,10 @@ class Q_GUI_EXPORT QKeyEvent : public QInputEvent
{
public:
QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
- bool autorep = false, ushort count = 1);
+ bool autorep = false, quint16 count = 1);
QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
- const QString &text = QString(), bool autorep = false, ushort count = 1,
+ const QString &text = QString(), bool autorep = false, quint16 count = 1,
const QInputDevice *device = QInputDevice::primaryKeyboard());
~QKeyEvent();
@@ -443,8 +443,8 @@ protected:
quint32 m_scanCode;
quint32 m_virtualKey;
quint32 m_modifiers;
- ushort m_count;
- ushort m_autoRepeat:1;
+ quint16 m_count;
+ quint16 m_autoRepeat : 1;
// ushort reserved:15;
};