From 53496e67f0b78645c6080e9218c7a36bc5a9d76d Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 14 Jul 2020 15:19:38 +0200 Subject: [PATCH] Un-deprecate QMouseEvent::flags() and QGraphicsSceneMouseEvent::flags() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 4e400369c08db251cd489fec1229398c224d02b4 Task-number: QTBUG-25831 Change-Id: I9a3b4f6cc6b858012186f10ed57689f8c0f5fd79 Reviewed-by: Tor Arne Vestbø --- src/gui/kernel/qevent.cpp | 1 - src/gui/kernel/qevent.h | 1 - src/widgets/graphicsview/qgraphicssceneevent.cpp | 1 - src/widgets/graphicsview/qgraphicssceneevent.h | 4 ---- 4 files changed, 7 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 0284dc2098..017ad39311 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -540,7 +540,6 @@ Qt::MouseEventSource QMouseEvent::source() const /*! \since 5.3 - \deprecated in 6.0 Returns the mouse event flags. diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 0e17cca4e8..f1c8b09a29 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -307,7 +307,6 @@ public: QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") QPointF screenPos() const { return globalPosition(); } Qt::MouseEventSource source() const; - QT_DEPRECATED_VERSION_X_6_0("Internal, don't use") Qt::MouseEventFlags flags() const; #endif // QT_DEPRECATED_SINCE(6, 0) }; diff --git a/src/widgets/graphicsview/qgraphicssceneevent.cpp b/src/widgets/graphicsview/qgraphicssceneevent.cpp index af2f87211f..048ea6dc7d 100644 --- a/src/widgets/graphicsview/qgraphicssceneevent.cpp +++ b/src/widgets/graphicsview/qgraphicssceneevent.cpp @@ -653,7 +653,6 @@ void QGraphicsSceneMouseEvent::setSource(Qt::MouseEventSource source) /*! \since 5.4 - \deprecated in 6.0 Returns the mouse event flags. diff --git a/src/widgets/graphicsview/qgraphicssceneevent.h b/src/widgets/graphicsview/qgraphicssceneevent.h index f47b1a4d4f..4a47b642fe 100644 --- a/src/widgets/graphicsview/qgraphicssceneevent.h +++ b/src/widgets/graphicsview/qgraphicssceneevent.h @@ -121,12 +121,8 @@ public: Qt::MouseEventSource source() const; 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_DEPRECATED_VERSION_X_6_0("Internal, don't use") void setFlags(Qt::MouseEventFlags); -#endif // QT_DEPRECATED_SINCE(6, 0) private: Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)