Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Wait in for loop till QDialog closes

$
0
0
Hi, this might be pretty simple but obviously i cant find the right words to get an answer from google. I got a QMainWindow and in a function which contains a for loop that runs through a QStringList with filenames. Now i want to generates a QDialog for each file that matches a QString in the filename. Pseudo Code: void MainWindow::somefunction() {   for (int i = 0; i < filelist.size(); i++)   {      if (filelist.at(i).contains("xyz"))      {         QDialog *newdialog = new QDialog(this);         newdialog->exec();         //here i need to wait for the dialog to be closed.      }   } } The above pseudocode would create 1 Dialog for each file which could result in a lot of dialogs at the same time. What i want to achieve is that only 1 Dialog will be created and wait for it to close before proceeding with the loop.

Viewing all articles
Browse latest Browse all 18427

Trending Articles