From 76dc75c5ff32f61782a413df4915f4ebe9236d76 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 16 Nov 2020 14:57:20 +0100 Subject: Allow QMutableSinglePointEvent to be copy- and default-constructed Since QMutableSinglePointEvent is just an access-helper to QSinglePointEvent, we can safely create one from the other. This covers QMouseEvent as well with the right casting in place. And by making QMSPE default constructable, we can use it in code that needs to frequently copy event data, for example in QtQuick. This allows us to make the copy c'tor and assignment operators for QEvent classes protected, which prevents potentially dangerous (ie. slicing) implicit copies. Change-Id: I815774847cca63896f46c43df683053b3d952b61 Reviewed-by: Lars Knoll Reviewed-by: Shawn Rutledge --- src/widgets/graphicsview/qgraphicsview_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/graphicsview/qgraphicsview_p.h') diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h index 8a8f6bf880..0b137e91dc 100644 --- a/src/widgets/graphicsview/qgraphicsview_p.h +++ b/src/widgets/graphicsview/qgraphicsview_p.h @@ -54,7 +54,7 @@ #include #include "qgraphicsview.h" -#include +#include #include #include "qgraphicssceneevent.h" #include @@ -123,7 +123,7 @@ public: qreal topIndent; // Replaying mouse events - QMouseEvent lastMouseEvent; + QMutableSinglePointEvent lastMouseEvent; void replayLastMouseEvent(); void storeMouseEvent(QMouseEvent *event); void mouseMoveEventHandler(QMouseEvent *event); -- cgit v1.2.3