[Interest] QWindowSystemInterface::flushWindowSystemEvents() causes signals to be handled in the wrong order?
michel.rosien at gmail.com
Wed Aug 7 10:19:34 CEST 2013
I recently upgraded to Qt5.1 (from Qt4.8) and started noticing strange
behavior with signal handling.
It looks like signals are being handled while another signal is still being
In this call stack:
Qt5Guid.dll!QWindowSystemInterface::flushWindowSystemEvents() Line 554 C++
qwindowsd.dll!QWindowsWindow::~QWindowsWindow() Line 847 C++
qwindowsd.dll!QWindowsWindow::`scalar deleting destructor'(unsigned
Qt5Guid.dll!QWindow::destroy() Line 1489 C++
Qt5Widgetsd.dll!QWidgetPrivate::deleteTLSysExtra() Line 917 C++
Qt5Widgetsd.dll!QWidget::destroy(bool destroyWindow=true, bool
destroySubWindows=true) Line 204 C++
Qt5Widgetsd.dll!QWidget::~QWidget() Line 1484 C++
you see that the flushWindowsSystemEvents is called as part of the ~QWidget
It seems that this call causes pending signals to be handled immediately.
In my application a QWidget can be created/destroyed using a toggle button.
If the button is pressed rapidly, so many 'on' - 'off' - 'on' - 'off'
signals are being send, it can occur that an 'on' signal is handled while
an 'off' handler is still in progress (because the 'off' handler deletes
Am I forced to use deleteLater instead of delete for a QWidget in this
case? I would like to prevent this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest