Here is another question that I was not able to answer myself or find a solution in the net...
I'm working with QMdiArea and I have multiple tabs opened (web browser like application). I'm trying to display a message box in a single tab, in a way that it does not block the whole application, but only blocks the parent widget (the current tab/QMdiSubWindow). This message box should not block the other tabs and the user should be able to switch to another tab, even if the message box in the current tab is still opened.
What I have tried so far is:
Qt Code:
  1. QMessageBox *box=new QMessageBox(qobject_cast<QWidget *>(parent())); //The cast here produces a pointer to my custom widget, which is contained in the tab/QMdiSubWindow.
  2. box->setAttribute(Qt::WA_DeleteOnClose);
  3. box->setStandardButtons(QMessageBox::Ok);
  4. box->setWindowModality(Qt::WindowModal); //setting modality to Qt::NonModal does not lock the current tab, so it is not a solution
  5. box->setWindowTitle("Message:");
  6. box->setText("My test message.");
  7. connect(box,SIGNAL(destroyed()),this,SLOT(Continue()));
  8. box->show();
To copy to clipboard, switch view to plain text mode 

The description of the Qt::WindowModal constant says:
The window is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows.
and if I understand it correctly, "...parent window, all grandparent windows, and all siblings of its parent and grandparent windows", basically means the whole application. And that's what happens in reality - it blocks the whole application, just like Qt::ApplicationModal.
I'm tackling this for a few hours now and I feel frustrated. Can someone please give any other ideas how I can achieve my goal???