diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-11-09 16:03:59 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-11-10 19:08:44 +0100 |
commit | ef051a61f6e458cb89b6ef20b5d55cb1e001dd93 (patch) | |
tree | 33dedfc32d6d2b587c2bf5c6cc858241dfdeeee1 /src/corelib/kernel | |
parent | 88efeb9e258a473ca5f98eaf2ee25719e23263fd (diff) |
Rename remaining QEvent variables to m_ convention; init m_reserved
Change-Id: I08694657b7c9d2713d0cb33519698dbba3bfdffa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 18 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication_p.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreevent.cpp | 16 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreevent.h | 10 |
5 files changed, 25 insertions, 23 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index ec227f6d99..5f169674fc 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -492,7 +492,7 @@ void QCoreApplicationPrivate::cleanupThreadData() const QPostEvent &pe = thisThreadData->postEventList.at(i); if (pe.event) { --pe.receiver->d_func()->postedEvents; - pe.event->posted = false; + pe.event->m_posted = false; delete pe.event; } } @@ -1050,7 +1050,7 @@ bool QCoreApplication::notifyInternal2(QObject *receiver, QEvent *event) bool QCoreApplication::forwardEvent(QObject *receiver, QEvent *event, QEvent *originatingEvent) { if (event && originatingEvent) - event->spont = originatingEvent->spont; + event->m_spont = originatingEvent->m_spont; return notifyInternal2(receiver, event); } @@ -1431,7 +1431,7 @@ bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event) Q_TRACE(QCoreApplication_sendEvent, receiver, event, event->type()); if (event) - event->spont = false; + event->m_spont = false; return notifyInternal2(receiver, event); } @@ -1443,7 +1443,7 @@ bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *event) Q_TRACE(QCoreApplication_sendSpontaneousEvent, receiver, event, event->type()); if (event) - event->spont = true; + event->m_spont = true; return notifyInternal2(receiver, event); } @@ -1563,7 +1563,7 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority) Q_TRACE(QCoreApplication_postEvent_event_posted, receiver, event, event->type()); data->postEventList.addEvent(QPostEvent(receiver, event, priority)); eventDeleter.take(); - event->posted = true; + event->m_posted = true; ++receiver->d_func()->postedEvents; data->canWait = false; locker.unlock(); @@ -1774,7 +1774,7 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type // first, we diddle the event so that we can deliver // it, and that no one will try to touch it later. - pe.event->posted = false; + pe.event->m_posted = false; QEvent *e = pe.event; QObject * r = pe.receiver; @@ -1844,7 +1844,7 @@ void QCoreApplication::removePostedEvents(QObject *receiver, int eventType) if ((!receiver || pe.receiver == receiver) && (pe.event && (eventType == 0 || pe.event->type() == eventType))) { --pe.receiver->d_func()->postedEvents; - pe.event->posted = false; + pe.event->m_posted = false; events.append(pe.event); const_cast<QPostEvent &>(pe).event = nullptr; } else if (!data->postEventList.recursion) { @@ -1881,7 +1881,7 @@ void QCoreApplication::removePostedEvents(QObject *receiver, int eventType) void QCoreApplicationPrivate::removePostedEvent(QEvent * event) { - if (!event || !event->posted) + if (!event || !event->m_posted) return; QThreadData *data = QThreadData::current(); @@ -1906,7 +1906,7 @@ void QCoreApplicationPrivate::removePostedEvent(QEvent * event) pe.receiver->objectName().toLocal8Bit().data()); #endif --pe.receiver->d_func()->postedEvents; - pe.event->posted = false; + pe.event->m_posted = false; delete pe.event; const_cast<QPostEvent &>(pe).event = nullptr; return; diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 04a740caf1..c711c48a85 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -120,7 +120,7 @@ public: bool sendThroughApplicationEventFilters(QObject *, QEvent *); static bool sendThroughObjectEventFilters(QObject *, QEvent *); static bool notify_helper(QObject *, QEvent *); - static inline void setEventSpontaneous(QEvent *e, bool spontaneous) { e->spont = spontaneous; } + static inline void setEventSpontaneous(QEvent *e, bool spontaneous) { e->m_spont = spontaneous; } virtual void createEventDispatcher(); virtual void eventDispatcherReady(); diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index b3b3e6c4da..628313fbac 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -865,7 +865,7 @@ void QCoreApplicationPrivate::removePostedTimerEvent(QObject *object, int timerI && (pe.event->type() == QEvent::Timer || pe.event->type() == QEvent::ZeroTimerEvent) && static_cast<QTimerEvent *>(pe.event)->timerId() == timerId) { --pe.receiver->d_func()->postedEvents; - pe.event->posted = false; + pe.event->m_posted = false; delete pe.event; const_cast<QPostEvent &>(pe).event = 0; return; diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index af89524dc4..ceb1a35775 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -294,8 +294,9 @@ QT_BEGIN_NAMESPACE Contructs an event object of type \a type. */ QEvent::QEvent(Type type) - : d(nullptr), t(type), posted(false), spont(false), m_accept(true), - m_inputEvent(false), m_pointerEvent(false), m_singlePointEvent(false) + : d(nullptr), t(type), m_posted(false), m_spont(false), m_accept(true), + m_inputEvent(false), m_pointerEvent(false), m_singlePointEvent(false), + m_reserved(0) { Q_TRACE(QEvent_ctor, this, t); } @@ -305,9 +306,10 @@ QEvent::QEvent(Type type) Copies the \a other event. */ QEvent::QEvent(const QEvent &other) - : d(other.d), t(other.t), posted(other.posted), spont(other.spont), + : d(other.d), t(other.t), m_posted(other.m_posted), m_spont(other.m_spont), m_accept(other.m_accept), m_inputEvent(other.m_inputEvent), - m_pointerEvent(other.m_pointerEvent), m_singlePointEvent(other.m_singlePointEvent) + m_pointerEvent(other.m_pointerEvent), m_singlePointEvent(other.m_singlePointEvent), + m_reserved(other.m_reserved) { Q_TRACE(QEvent_ctor, this, t); // if QEventPrivate becomes available, make sure to implement a @@ -355,8 +357,8 @@ QEvent &QEvent::operator=(const QEvent &other) Q_ASSERT_X(!other.d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); t = other.t; - posted = other.posted; - spont = other.spont; + m_posted = other.m_posted; + m_spont = other.m_spont; m_accept = other.m_accept; return *this; } @@ -369,7 +371,7 @@ QEvent &QEvent::operator=(const QEvent &other) QEvent::~QEvent() { Q_TRACE(QEvent_dtor, this, t); - if (posted && QCoreApplication::instance()) + if (m_posted && QCoreApplication::instance()) QCoreApplicationPrivate::removePostedEvent(this); Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); } diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index 88262659e9..4beb064d92 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -298,7 +298,7 @@ public: virtual ~QEvent(); QEvent &operator=(const QEvent &other); inline Type type() const { return static_cast<Type>(t); } - inline bool spontaneous() const { return spont; } + inline bool spontaneous() const { return m_spont; } inline virtual void setAccepted(bool accepted) { m_accept = accepted; } inline bool isAccepted() const { return m_accept; } @@ -323,13 +323,13 @@ protected: quint16 t; private: - quint16 posted : 1; - quint16 spont : 1; + quint16 m_posted : 1; + quint16 m_spont : 1; quint16 m_accept : 1; quint16 m_inputEvent : 1; quint16 m_pointerEvent : 1; quint16 m_singlePointEvent : 1; - quint16 reserved : 10; + quint16 m_reserved : 10; friend class QCoreApplication; friend class QCoreApplicationPrivate; @@ -345,7 +345,7 @@ private: friend class QSpontaneKeyEvent; // needs this: Q_ALWAYS_INLINE - void setSpontaneous() { spont = true; } + void setSpontaneous() { m_spont = true; } }; class Q_CORE_EXPORT QTimerEvent : public QEvent |