Fix deprecation of QMouseEvent::source() and flags()

Amends 53496e67f0b78645c6080e9218c7a36bc5a9d76d:
- move flags() out of the QT_DEPRECATED_SINCE block in the header
- add QT_DEPRECATED_SINCE block around source() implementation

Change-Id: Id52fa6b04a13efbede3e6ac440060f90b283e773
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ba8f9d8d92ba4fd9aaf6e0885b56b56e25acfc45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Shawn Rutledge 2021-08-27 16:15:28 +02:00 committed by Qt Cherry-pick Bot
parent 626418ad13
commit f906f1d1ce
2 changed files with 3 additions and 1 deletions

View File

@ -803,10 +803,12 @@ QMouseEvent::~QMouseEvent()
\sa Qt::MouseEventSource
\sa QGraphicsSceneMouseEvent::source()
*/
#if QT_DEPRECATED_SINCE(6, 0)
Qt::MouseEventSource QMouseEvent::source() const
{
return Qt::MouseEventSource(m_source);
}
#endif
/*!
\since 5.3

View File

@ -272,8 +272,8 @@ public:
QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
QPointF screenPos() const { return globalPosition(); }
Qt::MouseEventSource source() const;
Qt::MouseEventFlags flags() const;
#endif // QT_DEPRECATED_SINCE(6, 0)
Qt::MouseEventFlags flags() const;
};
class Q_GUI_EXPORT QHoverEvent : public QSinglePointEvent