[Interest] mouseDoubleClickEvent in Qt 5.1

John Weeks john at wavemetrics.com
Tue Jun 18 00:50:10 CEST 2013


When I build our application against Qt 5.1.0 (qmake version 3.0) a double-click results in the following sequence of events:

mousePressEvent()
mouseReleaseEvent()
mousePressEvent()
mouseDoubleClickEvent()
mouseReleaseEvent()

The same application built against Qt 4.8.2 gives this sequence:

mousePressEvent()
mouseReleaseEvent()
mouseDoubleClickEvent()
mouseReleaseEvent()

Note that the second mousePressEvent is not there. I see this difference on both Macintosh and Windows.

The Qt 5 behavior makes it difficult to handle a double-click event. I am aware that you have to expect a mousePressEvent plus the mouseDoubleClickEvent, but I don't expect two mousePressEvents.

So my questions:

1) Is this the expected behavior for Qt5?

2) If it is by design, rather than a bug, how is my code supposed to know that the second mousePressEvent is actually the second click of a mouseDoubleClick event?

Thank you for any insight!

-John Weeks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130617/66ff419c/attachment.html>


More information about the Interest mailing list