cranfss
12th May 2010, 00:52
I am passing a MdiArea into a QWidget *child:
mdiArea = new QMdiArea;
setCentralWidget(mdiArea);
tabWidget = new QTabWidget;
QWidget *child = new parametertab(tabWidget, mdiArea);
mdiArea->addSubWindow(child); //this addSubWindow works as expected
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();
...
}
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?
}
mdiArea = new QMdiArea;
setCentralWidget(mdiArea);
tabWidget = new QTabWidget;
QWidget *child = new parametertab(tabWidget, mdiArea);
mdiArea->addSubWindow(child); //this addSubWindow works as expected
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();
...
}
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?
}