Sorry but my 'w' is: MainForm w;
Quote Originally Posted by wysota
Qt Code:
  1. QWidget *w = new QWidget(this);
  2. QWidget *chld = new QWidget(this);
  3. l->addWidget(chld);
  4. w->setLayout(l);
  5. stackedWidget->addWidget(w);
To copy to clipboard, switch view to plain text mode 
In anyway, your code get this error:
Qt Code:
  1. error C2248: 'QWidget::setLayout' : cannot access private member declared in class 'QWidget'
To copy to clipboard, switch view to plain text mode 
I am in main.cpp...