<div dir="ltr"><div>Hello All,</div><div> </div><div>I recently upgraded to Qt5.1 (from Qt4.8) and started noticing strange behavior with signal handling.</div><div>It looks like signals are being handled while another signal is still being handled.</div>
<div> </div><div>In this call stack:</div><div> </div><div>  Qt5Guid.dll!QWindowSystemInterface::flushWindowSystemEvents() Line 554 C++<br>  qwindowsd.dll!QWindowsWindow::~QWindowsWindow() Line 847 C++<br>  qwindowsd.dll!QWindowsWindow::`scalar deleting destructor'(unsigned int) C++<br>
  Qt5Guid.dll!QWindow::destroy() Line 1489 C++<br>  Qt5Widgetsd.dll!QWidgetPrivate::deleteTLSysExtra() Line 917 C++<br>  Qt5Widgetsd.dll!QWidget::destroy(bool destroyWindow=true, bool destroySubWindows=true) Line 204 C++<br>
  Qt5Widgetsd.dll!QWidget::~QWidget() Line 1484 C++<br></div><div>you see that the flushWindowsSystemEvents is called as part of the ~QWidget destructor.</div><div>It seems that this call causes pending signals to be handled immediately.</div>
<div> </div><div>In my application a QWidget can be created/destroyed using a toggle button.</div><div>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 the widget)</div>
<div> </div><div>Am I forced to use deleteLater instead of delete for a QWidget in this case? I would like to prevent this.</div><div> </div><div>Any thoughts?</div><div> </div><div>Regards,</div><div>Michel</div></div>