This program shows a QLineEdit and a QPushButton. When you push the button, a dialog appears. I want it to be possible to keep editing the QLineEdit while the dialog is shown. (Qt-4.6.0-tp1)

Qt Code:
  1. #include <QApplication>
  2. #include <QPushButton>
  3. #include <QLineEdit>
  4. #include <QMessageBox>
  5. #include <QLabel>
  6.  
  7. class Button : public QPushButton
  8. {
  9. Q_OBJECT
  10. public:
  11. Button(QString t) : QPushButton(t)
  12. {
  13. connect(this, SIGNAL(clicked()), this, SLOT(bom()));
  14. }
  15. public slots:
  16. void bom() {
  17. QLabel dummyparent;
  18. QMessageBox::question(&dummyparent, "Modality", "Can you still edit the QLineEdit?");
  19. }
  20. };
  21.  
  22.  
  23. int main( int argc, char **argv )
  24. {
  25. QApplication app( argc, argv );
  26.  
  27. QLineEdit *le = new QLineEdit("edit me");
  28. le->show();
  29.  
  30. Button *but = new Button("Push Me");
  31. but->show();
  32.  
  33. return app.exec();
  34. }
  35.  
  36. #include "prog.moc"
To copy to clipboard, switch view to plain text mode 

In the docs, it says that a dialog will be WindowModal as opposed to ApplicationModal if it has a parent, so I gave it a dummy parent, hoping it would then not block input to my QLineEdit, but it does.

From docs about Qt::WindowModal:

"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."

Does this mean that a top level-window is considered a sibling to all other top-level windows?

I know I could forgo the convenient static QMessageBox methods and build a dialog by setting properties one by one, showing it and then running some sort of event lopp until it's done, but I was looking for a simpler way of making the dialog less modal.