Dear visitor, welcome to QtForum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
QMessageBox stays - QDialog not?
Hello,
If i create a simple dialog via QMessageBox then it stays in top of my mainwindow and i cannot click anything else in my mainwindow until i make something with the QMessageBox. Now i want such a behavior in my QDialog too. I mean that it stays on top and i cannot click anything elsewhere until i do something with the QDialog. I found QDialog::setWFlags() but it didn't work (i guess).
thank you!
RE: QMessageBox stays - QDialog not?
What you need it a modal dialog. Use exec() method to display any dialog as modal or, if you prefer
to use show(), invoke setModal(true) (check out the third parameter of QDialog's constructor also).