Un-deprecate QMouseEvent::flags() and QGraphicsSceneMouseEvent::flags()

On one hand it looks like API clutter: a whole Qt namespace enum just
to track whether an individual mouse click is about to geenerate a
MouseButtonDblClick event. On the other hand, we should not remove it
without replacing it somehow, so that users don't lose the workaround for
QTBUG-25831 that it provides. That would be an invasive change because
this flags property exists in QMouseEvent, QGraphicsSceneMouseEvent
and in MouseArea { onClicked: doSomethingWith(mouse.flags) }

Reverts a small part of 4e400369c0

Task-number: QTBUG-25831
Change-Id: I9a3b4f6cc6b858012186f10ed57689f8c0f5fd79
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Shawn Rutledge 2020-07-14 15:19:38 +02:00
parent 5ca5dfa89e
commit 53496e67f0
4 changed files with 0 additions and 7 deletions

View File

@ -540,7 +540,6 @@ Qt::MouseEventSource QMouseEvent::source() const
/*! /*!
\since 5.3 \since 5.3
\deprecated in 6.0
Returns the mouse event flags. Returns the mouse event flags.

View File

@ -307,7 +307,6 @@ public:
QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
QPointF screenPos() const { return globalPosition(); } QPointF screenPos() const { return globalPosition(); }
Qt::MouseEventSource source() const; Qt::MouseEventSource source() const;
QT_DEPRECATED_VERSION_X_6_0("Internal, don't use")
Qt::MouseEventFlags flags() const; Qt::MouseEventFlags flags() const;
#endif // QT_DEPRECATED_SINCE(6, 0) #endif // QT_DEPRECATED_SINCE(6, 0)
}; };

View File

@ -653,7 +653,6 @@ void QGraphicsSceneMouseEvent::setSource(Qt::MouseEventSource source)
/*! /*!
\since 5.4 \since 5.4
\deprecated in 6.0
Returns the mouse event flags. Returns the mouse event flags.

View File

@ -121,12 +121,8 @@ public:
Qt::MouseEventSource source() const; Qt::MouseEventSource source() const;
void setSource(Qt::MouseEventSource source); void setSource(Qt::MouseEventSource source);
#if QT_DEPRECATED_SINCE(6, 0)
QT_DEPRECATED_VERSION_X_6_0("Internal, don't use")
Qt::MouseEventFlags flags() const; Qt::MouseEventFlags flags() const;
QT_DEPRECATED_VERSION_X_6_0("Internal, don't use")
void setFlags(Qt::MouseEventFlags); void setFlags(Qt::MouseEventFlags);
#endif // QT_DEPRECATED_SINCE(6, 0)
private: private:
Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent) Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)