Priority: P3: Somewhat important
Affects Version/s: 5.4.1, 5.6
Fix Version/s: None
Component/s: Widgets: Widgets and Dialogs
Environment:Windows 7 x64, Visual Studio 2010 x64
The following steps reproduce the issue:
- Open a popup widget (setWindowFlags(Qt::Popup)). (Right click, in the attached test application.)
- Click outside the popup widget, inside the main window.
- The main window now correctly receives a QEvent::MouseButtonPress event, but it does not always receive a QEvent::MouseButtonRelease event.
- Even QApplication::mouseButtons() keeps thinking the mouse button is down.
This only seems to happen if the click is very short, or more accurately, it seems to relate to the rate at which the event queue is processed. If I deliberately slow the event processing down by sleeping in an idle timer (as in the attached example), the bug occurs more often and can be easily reproduced. I feel that it happens only if the press and release events happen to be handled in the same iteration of event queue processing, but that is just a guess.
I first noticed the issue with 5.4.1 and reproduced it in 5.6 (built from git, f8ae5ee3b624e65c7bc1fe7c76d0004b5ff9f894).
I attempted to reproduce it on Scientific Linux 6 too. There neither the pressed or released event occur, but I think that is by design.