I can not show with button click a subWindow(ui) created in ui QMdiArea.
-
[6_1535401305063_resources.qrc](Uploading 100%) [5_1535401305063_main.cpp](Uploading 100%) [4_1535401305063_mymainwindow.h](Uploading 100%) [3_1535401305062_mymainwindow.ui](Uploading 100%) [2_1535401305062_Test14.pro.user](Uploading 100%) [1_1535401305062_Test14.pro](Uploading 100%) [0_1535401305061_mymainwindow.cpp](Uploading 100%)
-
Hi and welcome to devnet,
Your uploads are not visible.
That said, you should at least give a description of your problem and how to exactly reproduce it. Just uploading your project and expect people to read through it, build it and debug your problem shows a lack of respect for their time.
-
Thank you very much.
For test purpose, I have created a QMdiArea and subwindows in mainwindow. Normally, I call mainwindow and appearing mdiArea and subwindows. In order to prevent opening of all subwindows in mdiArea, I closed all active windows.
After all, I want to call any subwindow a toolbutton. Unfortunately, after clicking the toolbutton, the application returns a message like that "The program has unexpectedly finished." -
-
I think, the problem is; after closing active subwindows in mdiArea, calling them with a button click.
-
That link you posted is empty.
Do you mean you are trying to access a closed widget ? From the looks of it you likely are trying to access a dangling pointer.
-
Thank you very much. It is definition issue.
For example:
.h file
public:
SecondForm *mywidget;
ThirdForm *thirdForm;
.cpp file
if (ui->mdiArea->activeSubWindow() == 0x0){
mywidget = new SecondForm(this);
ui->mdiArea->addSubWindow(mywidget);
mywidget->resize(500,500);
mywidget->show();
}
For nonmodal windows.
it is working.
For modal windows instance creation is necessary. -
What do you mean by non modal window ?
-
Sorry, I mean "modal or modeless window".
-
That's usually applied to dialogs. Is that what you were using ?