Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.2, 5.1.1, 5.2.0
-
None
-
Linux x86_64, Debian/testing, Qt 5.0.0a, no additional configure arguments, WM is xfwm4
-
9063edef796ad10eb9ac2229627f36d60168f0e2, Menu regression fix-up: 828cfb4019939a39c84e5c5e17dc8cb52e9f63fd (stable, 3.4.2014, 5.3)
Description
There's a slight difference in event handling between Qt 4 and 5 when receiving mouse double clicks:
4.8.6 #0 MouseButtonPress widget QWidget(0xd4caa0, name = "Widget") #1 MouseButtonRelease widget QWidget(0xd4caa0, name = "Widget") #2 MouseButtonDblClick widget QWidget(0xd4caa0, name = "Widget") #3 MouseButtonRelease widget QWidget(0xd4caa0, name = "Widget")
5.2.1 #0 MouseButtonPress window QWidgetWindow(0x1bd4f80, name = "WidgetWindow") #0 MouseButtonPress widget QWidget(0x1bd47f0, name = "Widget") #1 MouseButtonRelease window QWidgetWindow(0x1bd4f80, name = "WidgetWindow") #1 MouseButtonRelease widget QWidget(0x1bd47f0, name = "Widget") #2 MouseButtonPress window QWidgetWindow(0x1bd4f80, name = "WidgetWindow") #2 MouseButtonPress widget QWidget(0x1bd47f0, name = "Widget") #3 MouseButtonDblClick window QWidgetWindow(0x1bd4f80, name = "WidgetWindow") #3 MouseButtonDblClick widget QWidget(0x1bd47f0, name = "Widget") #4 MouseButtonRelease window QWidgetWindow(0x1bd4f80, name = "WidgetWindow") #4 MouseButtonRelease widget QWidget(0x1bd47f0, name = "Widget")
5.3.1 (with fix applied) #0 MouseButtonPress window flags:0 src:0 QWidgetWindow(0xab9bf0, name = "WidgetWindow") #0 MouseButtonPress widget flags:0 src:0 QWidget(0xab68c0, name = "Widget") #1 MouseButtonRelease window flags:0 src:0 QWidgetWindow(0xab9bf0, name = "WidgetWindow") #1 MouseButtonRelease widget flags:0 src:0 QWidget(0xab68c0, name = "Widget") #2 MouseButtonPress window flags:1 src:0 QWidgetWindow(0xab9bf0, name = "WidgetWindow") #3 MouseButtonDblClick window flags:0 src:0 QWidgetWindow(0xab9bf0, name = "WidgetWindow") #2 MouseButtonDblClick widget flags:0 src:0 QWidget(0xab68c0, name = "Widget") #4 MouseButtonRelease window flags:0 src:0 QWidgetWindow(0xab9bf0, name = "WidgetWindow") #3 MouseButtonRelease widget flags:0 src:0 QWidget(0xab68c0, name = "Widget")
I'd just like to clarify if this change is intended for Qt 5, I can clearly see the logic of sending all three events for the last click.
Minimal example code to produce the above output of event names:
#include <qapplication.h> #include <qevent.h> #include <qwidget.h> class EventDumper: public QWidget { public: EventDumper(): QWidget( 0 ) {} virtual bool event( QEvent *ev ) { const QEvent::Type et = ev->type(); switch ( et ) { case QEvent::MouseButtonDblClick: qDebug("MouseButtonDblClick"); return true; case QEvent::MouseButtonPress: qDebug("MouseButtonPress"); return true; case QEvent::MouseButtonRelease: qDebug("MouseButtonRelease"); return true; default: break; } return QWidget::event( ev ); } }; int main( int argc, char **argv ) { QApplication app( argc, argv ); EventDumper ed; ed.show(); return app.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-36418 Fix for QTBUG-25831 should have autotest
- Reported
-
QTBUG-40239 Opening and closing native dialog after double click leaves mouse press active
- Closed
-
QTBUG-39023 [REG 5.2.1->5.3] Double click to select multiple words in multiline text widgets does not work
- Closed
- resulted in
-
QTBUG-38242 [REG 5.2.1->5.3] QCheckBox has a dead time after being clicked
- Closed
-
QTBUG-37891 Windows:Menu bar doesn't handle mouse click and move properly
- Closed