Dialog is showed and immediatly closed because out of scope. Try something like this :
Qt Code:
  1. void MainWindow::actionTest()
  2. {
  3. Dialog *dlg = new Dialog();
  4. //to auto delete after close
  5. dlg->setAttribute( Qt::WA_DeleteOnClose, true );
  6. dlg->show();
  7. }
To copy to clipboard, switch view to plain text mode