I am passing a MdiArea into a QWidget *child:
Qt Code:
  1. mdiArea = new QMdiArea;
  2. setCentralWidget(mdiArea);
  3.  
  4. tabWidget = new QTabWidget;
  5. QWidget *child = new parametertab(tabWidget, mdiArea);
  6.  
  7. 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?
Qt Code:
  1. class parametertab : public QWidget
  2. {
  3. ...
  4. private slots:
  5. void runsim();
  6. ...
  7. }
  8.  
  9. parametertab::parametertab(QTabWidget *tW, QMdiArea *ma, QWidget *parent)
  10. : QWidget(parent)
  11. {
  12. ...
  13. QWidget *child = new QTextEdit;
  14. mdiArea->addSubWindow(child); //this works as expected
  15. ...
  16. }
  17.  
  18. void parametertab::runsim()
  19. {
  20. QWidget *child = new QTextEdit;
  21. mdiArea->addSubWindow(child); //does not show window?
  22. }
To copy to clipboard, switch view to plain text mode