Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.3.0, 5.15
-
None
Description
Please have a look at the stack trace's picture.
I get a crash in my application because some code of mine, dependent on user input, is called at unexpected time.
The typical scenario is when a widget is shown. This causes the event queue, including user events, to be flushed. We certainly don't expect user events to be processed when "setVisible" is called on a widget.
I get this on Mac, but got it once on Windows too (in this case, a tip window move caused the flushing).
I see this as a design flaw (never had this in Qt 4.8): the user input events should not be flushed when showing a window, and actually in most contexts.
QWindowSystemInterface::flushWindowSystemEvents()
should have a QEventLoop::ProcessEventsFlag argument, just as sendWindowSystemEvents has.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-39842 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
88461,1 | Don't flush user input events from setVisible | 5.3 | qt/qtbase | Status: ABANDONED | 0 | 0 |
97696,4 | QPA: Flush window system events with flags. | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |
97697,4 | Don't flush user input events from setVisible | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |
160988,10 | Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for full update only | 5.9 | qt/qtbase | Status: MERGED | -2 | 0 |
161096,3 | Remove tst_QWidget::immediateRepaintAfterShow(). | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |
161369,4 | Windows QPA: Pass ExcludeUserInputEvents to QWSI::flushWindowSystemEvents() | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |
183862,1 | Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for full update only | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |