Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.0.0
Description
The QMouseEvent objects created in sequence overwrite the previously created QMouseEvent global coordinates. This is demonstrated by the following test program:
#include <QGuiApplication> #include <QMouseEvent> #include <cstdio> int main( int argc, char* argv[] ) { QGuiApplication app( argc, argv ); QMouseEvent ev1( QEvent::MouseButtonPress, QPointF( 0.0, 0.0 ), QPointF( 10.0, 10.0 ), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier ); fprintf( stderr, "Event 1 at: %d x %d\n", ev1.globalX(), ev1.globalY() ); QMouseEvent ev2( QEvent::MouseButtonPress, QPointF( 20.0, 20.0 ), QPointF( 30.0, 30.0 ), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier ); fprintf( stderr, "Event 1 at: %d x %d\n", ev1.globalX(), ev1.globalY() ); return 0; }
Expected output:
Event 1 at: 10 x 10 Event 1 at: 10 x 10
Actual output:
Event 1 at: 10 x 10 Event 1 at: 30 x 30
Attachments
Issue Links
- relates to
-
QTBUG-107560 QPointerEvent::clone does not do a deep copy, leaving the cloned object partially aliased
- Closed