[Qt-interest] Minimizing Mfc Application with with open Qt Dialog (repost)

elizabeta petreska elizabeta.petreska at gmail.com
Sun Sep 27 16:43:32 CEST 2009


Hello list

 and I am sorry for posting this in different thread, I certainly have some
issues with getting replies to my email. Also I can't
see replies in the mailing archive , only through my newsgroup reader. :(
This was my original thread
http://lists.trolltech.com/pipermail/qt-interest/2009-September/013149.html

Ok I guess I can use deleteLater in the closeEvent of my dialog and avoid
Qt::WA_DeleteOnClose ,like this :
MyQtDlg::closeEvent()
{
this->deleteLater();
}
This way the dialog will be deleted when I close it through X close button.

But what about when I close my Mfc application through its close X button ,
i.e I want all of my open modeless Qt dialogs to be deleted then. How can I
do that without using Qt::WA_DeleteOnClose ? If I use Qt::WA_DeleteOnClose
this is done for me because then the Qt dialogs gets SW_PARENTCLOSING
message.
I can see no clean way for doing this, expect mainting references to all my
open modeless dialogs and deleting them manually when my Mfc app is closed.
I hope is better way for doing this.


David Said
>>It certainly does seem Qt is interpreting the SW_PARENTCLOSING as the main
window being closed rather than minimized!  Seems like a >>bug.  (Of course
Microsoft did not do any favors by calling it SW_PARENTCLOSING instead of
SW_PARENTMINIMIZING which is really >>the case.)

>>As a workaround I suggest you remove the Qt::WA_DeleteOnClose attribute
from your main window.  You'll have to add code to shutdown >>your app when
the window is closed normally.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090927/711442a0/attachment.html 


More information about the Qt-interest-old mailing list