Hello.
I have a MDI area with a menu.
that i created like this.
setupUi(this);
mdiArea = new QMdiArea;
mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setCentralWidget(mdiArea);
setWindowTitle(tr("MDI"));
setUnifiedTitleAndToolBarOnMac(true);
setupUi(this);
mdiArea = new QMdiArea;
mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setCentralWidget(mdiArea);
setWindowTitle(tr("MDI"));
setUnifiedTitleAndToolBarOnMac(true);
To copy to clipboard, switch view to plain text mode
When one of hte options is clicked i create a window like this.
frmUserProfile *b = new frmUserProfile;
mdiArea->addSubWindow(b);
b->exec();
frmUserProfile *b = new frmUserProfile;
mdiArea->addSubWindow(b);
b->exec();
To copy to clipboard, switch view to plain text mode
Then from that window i want to open a second one when the user clicks on a button.
the problem is that mdiArea does not exist there and if i do
frmTest *t = new frmTest(this);
t->exec();
delete t;
frmTest *t = new frmTest(this);
t->exec();
delete t;
To copy to clipboard, switch view to plain text mode
The window is shown outside of the mdi area.
One workaround i found is to use a signal to make the mainwindow open frmTest, but it looks like a ugly thing to do and I'm sure other problems will arise from that method.
How can i fix the problem of Qdialogs appearing outside the MDIarea?
I realize that maybe this is more of a c++ problem than a Qt one, sorry for that.
Thanks!
Bookmarks