I am passing a MdiArea into a QWidget *child:
mdiArea = new QMdiArea;
setCentralWidget(mdiArea);
QWidget *child
= new parametertab
(tabWidget, mdiArea
);
mdiArea->addSubWindow(child); //this addSubWindow works as expected
mdiArea = new QMdiArea;
setCentralWidget(mdiArea);
tabWidget = new QTabWidget;
QWidget *child = new parametertab(tabWidget, mdiArea);
mdiArea->addSubWindow(child); //this addSubWindow works as expected
To copy to clipboard, switch view to plain text mode
Inside the parametertab constructor, I can addsubwindow, but it does not work when I addsubwindow from within a slot. It does add the window to the subWindowList, and does not produce a warning. Any idea why it does not display the window?
class parametertab
: public QWidget{
...
private slots:
void runsim();
...
}
{
...
mdiArea->addSubWindow(child); //this works as expected
...
}
void parametertab::runsim()
{
mdiArea->addSubWindow(child); //does not show window?
}
class parametertab : public QWidget
{
...
private slots:
void runsim();
...
}
parametertab::parametertab(QTabWidget *tW, QMdiArea *ma, QWidget *parent)
: QWidget(parent)
{
...
QWidget *child = new QTextEdit;
mdiArea->addSubWindow(child); //this works as expected
...
}
void parametertab::runsim()
{
QWidget *child = new QTextEdit;
mdiArea->addSubWindow(child); //does not show window?
}
To copy to clipboard, switch view to plain text mode
Bookmarks