diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-11-13 13:42:41 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-11-13 23:28:39 +0100 |
commit | 8a0a43bdaa216c131ab11b2bf7112eb746d7fc35 (patch) | |
tree | bc016d5c9f752cda8bf7a7a47fe6b4136467dbc0 /src/gui/kernel | |
parent | 64d62c53c1e92a1cc07449a0ea3c71501592c1e7 (diff) |
Inline trivial getters for QEvent subclasses
Change-Id: Ic0ee4f3e311e1068d23796cee4fe58008a2a8114
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 58 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 20 |
2 files changed, 27 insertions, 51 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 659f0e353b..c459ca3b6a 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4508,39 +4508,27 @@ QScrollPrepareEvent::~QScrollPrepareEvent() } /*! + \fn QPointF QScrollPrepareEvent::startPos() const + Returns the position of the touch or mouse event that started the scrolling. */ -QPointF QScrollPrepareEvent::startPos() const -{ - return m_startPos; -} /*! + \fn QSizeF QScrollPrepareEvent::viewportSize() const Returns size of the area that is to be scrolled as set by setViewportSize \sa setViewportSize() */ -QSizeF QScrollPrepareEvent::viewportSize() const -{ - return m_viewportSize; -} /*! + \fn QRectF QScrollPrepareEvent::contentPosRange() const Returns the range of coordinates for the content as set by setContentPosRange(). */ -QRectF QScrollPrepareEvent::contentPosRange() const -{ - return m_contentPosRange; -} /*! + \fn QPointF QScrollPrepareEvent::contentPos() const Returns the current position of the content as set by setContentPos. */ -QPointF QScrollPrepareEvent::contentPos() const -{ - return m_contentPos; -} - /*! Sets the size of the area that is to be scrolled to \a size. @@ -4623,25 +4611,23 @@ QScrollEvent::~QScrollEvent() } /*! + \fn QPointF QScrollEvent::contentPos() const + Returns the new scroll position. */ -QPointF QScrollEvent::contentPos() const -{ - return m_contentPos; -} /*! + \fn QPointF QScrollEvent::overshootDistance() const + Returns the new overshoot distance. See QScroller for an explanation of the term overshoot. \sa QScroller */ -QPointF QScrollEvent::overshootDistance() const -{ - return m_overshoot; -} /*! + \fn QScrollEvent::ScrollState QScrollEvent::scrollState() const + Returns the current scroll state as a combination of ScrollStateFlag values. ScrollStarted (or ScrollFinished) will be set, if this scroll event is the first (or last) event in a scrolling activity. Please note that both values can be set at the same time, if the activity consists of a single QScrollEvent. @@ -4649,10 +4635,6 @@ QPointF QScrollEvent::overshootDistance() const A widget could for example revert selections when scrolling is started and stopped. */ -QScrollEvent::ScrollState QScrollEvent::scrollState() const -{ - return m_state; -} /*! Creates a new QScreenOrientationChangeEvent @@ -4671,20 +4653,16 @@ QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent() } /*! + \fn QScreen *QScreenOrientationChangeEvent::screen() const + Returns the screen whose orientation changed. */ -QScreen *QScreenOrientationChangeEvent::screen() const -{ - return m_screen; -} /*! + \fn Qt::ScreenOrientation QScreenOrientationChangeEvent::orientation() const + Returns the orientation of the screen. */ -Qt::ScreenOrientation QScreenOrientationChangeEvent::orientation() const -{ - return m_orientation; -} /*! Creates a new QApplicationStateChangeEvent. @@ -4696,12 +4674,10 @@ QApplicationStateChangeEvent::QApplicationStateChangeEvent(Qt::ApplicationState } /*! + \fn Qt::ApplicationState QApplicationStateChangeEvent::applicationState() const + Returns the state of the application. */ -Qt::ApplicationState QApplicationStateChangeEvent::applicationState() const -{ - return m_applicationState; -} /*! \internal Add the given \a point. diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 609d59740e..2d17d68b3f 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -937,11 +937,11 @@ public: explicit QScrollPrepareEvent(const QPointF &startPos); ~QScrollPrepareEvent(); - QPointF startPos() const; + QPointF startPos() const { return m_startPos; } - QSizeF viewportSize() const; - QRectF contentPosRange() const; - QPointF contentPos() const; + QSizeF viewportSize() const { return m_viewportSize; } + QRectF contentPosRange() const { return m_contentPosRange; } + QPointF contentPos() const { return m_contentPos; } void setViewportSize(const QSizeF &size); void setContentPosRange(const QRectF &rect); @@ -968,9 +968,9 @@ public: QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState); ~QScrollEvent(); - QPointF contentPos() const; - QPointF overshootDistance() const; - ScrollState scrollState() const; + QPointF contentPos() const { return m_contentPos; } + QPointF overshootDistance() const { return m_overshoot; } + ScrollState scrollState() const { return m_state; } private: QPointF m_contentPos; @@ -984,8 +984,8 @@ public: QScreenOrientationChangeEvent(QScreen *screen, Qt::ScreenOrientation orientation); ~QScreenOrientationChangeEvent(); - QScreen *screen() const; - Qt::ScreenOrientation orientation() const; + QScreen *screen() const { return m_screen; } + Qt::ScreenOrientation orientation() const { return m_orientation; } private: QScreen *m_screen; @@ -996,7 +996,7 @@ class Q_GUI_EXPORT QApplicationStateChangeEvent : public QEvent { public: explicit QApplicationStateChangeEvent(Qt::ApplicationState state); - Qt::ApplicationState applicationState() const; + Qt::ApplicationState applicationState() const { return m_applicationState; } private: Qt::ApplicationState m_applicationState; |