<table><tr><td style="">maxrd2 added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D13808">View Revision</a></tr></table><br /><div><div><p>Thank you! QEventLoop and creating window with new operator did it. Now the only problem is that no matter how i close the window from code it's not reproducing behavior. Only closing the window manually through window manager works.<br />
Have tried:<br />
QApplication::postEvent(mw, new QCloseEvent); // this one does absolutely nothing<br />
QApplication::postEvent(mw, new QDeferredDeleteEvent);<br />
QTimer::singleShot(1000, [&](){ QApplication::sendEvent(mw, new QDeferredDeleteEvent); });<br />
mv.close();<br />
QTimer::singleShot(1000, [&](){ mv.close(); });</p>

<p>The close event from window manager is QDeferredDeleteEvent and has spontaneous flag, i didn't notice any other differences in debugger. Any ideas?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R263 KXmlGui</div></div></div><br /><div><strong>BRANCH</strong><div><div>fix-window-state-save</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D13808">https://phabricator.kde.org/D13808</a></div></div><br /><div><strong>To: </strong>maxrd2, KDE Applications, dfaure, elvisangelaccio, broulik, cfeck<br /><strong>Cc: </strong>wbauer, aacid, ngraham, kde-frameworks-devel, michaelh, bruns<br /></div>