Hi!!

I have an application where i can import raw videofiles and make some transformations on it.
When I am done I would want to open up a QDialog so that the user can specify some settings when exporting the sequence and when the user press the export button the sequence will be processed and exported. But I would want to keep it simple, i.e all this should be made in the same method with no connections like for example a QFileDialog.

I have made a new class that inherits from QDialog but I there must be some thing wrong.
When i call myDialog->exec() the dialog pops up but the code in the mainwindow contiues to execute.

I want the program to wait so that the user can make his choises in the dialog and when the ok button is pressed i can read out what settings was made and start export.
Kind of like this:
Qt Code:
  1. MyDialog myDialog = new MyDialog(this);
  2. QStringList settings = myDialog->exec();
To copy to clipboard, switch view to plain text mode 
or
Qt Code:
  1. MyDialog myDialog = new MyDialog(this);
  2. myDialog->exec();
  3. QStringList settings = myDialog->getSettings();
To copy to clipboard, switch view to plain text mode 

When I use QFileDialog it possible to do like:
Qt Code:
  1. QString file = QFileDialog::getSaveFileName(.........
To copy to clipboard, switch view to plain text mode 

This is how I do it now:
Qt Code:
  1. void MainWindow::exportSequence()
  2. {
  3. // open a dialog for choosing export settings
  4. MyDialog *md = new MyDialog(this);
  5. md->exec();
  6. qDebug() << esw->getSettings();
  7. //start exporting video
  8. .....
To copy to clipboard, switch view to plain text mode 
MyDialog:
Qt Code:
  1. class MyDialog: public QDialog
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. MyDialog(QWidget *parent=0);
  7.  
  8. QStringList getSettings() {return settings;}
  9. public slots:
  10. int exec();
  11. void done(int val);
  12. void accept();
  13. void reject();
  14. private:
  15. QStringList settings;
  16. QPushButton *exportButton;
  17. QPushButton *cancelButton;
  18. .....
  19. Lots of buttons and other stuff
  20. .....
  21. };
  22.  
  23. MyDialog::MyDialog(QWidget *parent) : QDialog(parent)
  24. {
  25.  
  26.  
  27. setModal(true);
  28. setFocusPolicy(Qt::StrongFocus);
  29. setFocus();
  30. ......
  31. exportButton = new QPushButton(tr("Export"));
  32. connect(exportButton, SIGNAL(clicked()), this, SLOT(accept()));
  33. cancelButton = new QPushButton(tr("Cancel"));
  34. connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
  35. .....
  36. }
  37. int MyDialog::exec()
  38. {
  39. activateWindow();
  40. this->show();
  41. return 1;
  42. }
  43. void MyDialog::done(int val)
  44. {
  45. printf("done()\n");
  46. }
  47.  
  48. void MyDialog::accept()
  49. {
  50. settings << "setting1" << "setting2" << "ect";
  51. printf("Accept.\n");
  52. this->hide();
  53. }
  54. void ExportSequenceWidget::reject()
  55. {
  56. settings.clear();
  57. printf("Reject.\n");
  58. this->hide();
  59. }
To copy to clipboard, switch view to plain text mode 

I have been looking at the examples but I can't really figure out how to do this.
Please help me solve this.
Many thanks.
//Nils