Deleting QWinWidget
Posted
by user152508
on Stack Overflow
See other posts from Stack Overflow
or by user152508
Published on 2009-10-12T08:42:00Z
Indexed on
2010/04/09
22:03 UTC
Read the original article
Hit count: 352
Hello
I am using mfc to Qt migration and I am showing Qt dialogs in my Mfc app. Is it Ok to deleteLater QWinWidget in its winEvent handler? The thing is that I want all of my open Qt dialogs in My Mfc application to be automatically deleted when the main mfc window is closed. Since WM_DESTROY will be sent for all child windows ( and the Qt widgets too) So I added the following code in QwinWidget winEvent handler :
QWinWidget::winEvent(MSG * message, long * result)
{
........
if(message->message == WM_DESTROY )
deleteLater();
return false;
}
Can someone comment this Thanks
© Stack Overflow or respective owner