Qt 6.11 is out! See what's new in the release
blog
QMessageBox in MFC application
General and Desktop
4
Posts
3
Posters
4.5k
Views
1
Watching
-
Hi Experts,
I have a MFC MDI application, and somewhere I'd like to pop up a QMessageBox.
However, I find that the message box is not modal, I still can interact with "view" and "main frame" in MFC world.
Here're my codes, any suggestions? Thanks!@
// parentHwnd is the HWND of CView from MFC
m_parent = new QWinWidget(parentHwnd);
QMessageBox msg(m_parent);
msg.exec();
@Thanks
Roger -
As I know if parent is not null the message box will be window modal relative to the parent. But it still not solves (if I understand well the comment in the first line) why you can interact with the view.
-
Thanks All, I find the cause: I should set parent window to main frame(instead of the view)