Hello

I am using QtWinMigrate solution to show dialogs from my plugin dlls that are loaded in third party Mfc application. The problem is the following :

When I minimize the main window of my Mfc application, and when I restore it back again, all of my open Qt dialogs are lost. I found out that actually my Qt dialogs are destroyed i.e destructors are called.

I did some debugging and discovered the following :

When I close my Mfc main window my Qt dialog gets WM_SHOWWINDOW message with SW_PARENTCLOSING wparam parametar. Then QtWndProc is called, which for the SW_PARENTCLOSING case issues sends QHideEvent:

in QtWndProc() function in file qapplication_win.cpp line 2160

Qt Code:
  1. case WM_SHOWWINDOW :
  2. if(lparam==SW_PARENTCLOSING) {
  3. qt_sendSpontaneousEvent(widget,e);
  4. widget->hideChildren(true); ////////////////////
To copy to clipboard, switch view to plain text mode 

and the eventFilter of QWinWidget sends DefferedDelete who deletes my dialog :

in QWinWidget.cpp in line 280

Qt Code:
  1. QWinWidget::eventFilter(OObject* o, QEvent* e)
  2. {
  3. ....
  4. case QEvent::Hide:
  5. if(w->testAtrribute(Qt::WA_DeleteOnClose)
  6. deleteLater();
  7. }
To copy to clipboard, switch view to plain text mode 

Can someone please explain this behavior to me? This seems like bug to me .

Thanks