Reputation: 23
I've been trying to create a QWidget
which behave like QMessageBox
.
When I have for example two QWidget
and one QMessageBox
until I don't close the QMessageBox
I can't available QWidget
!
Is it exist the function that the QWidget
behave like this?
Upvotes: 1
Views: 209
Reputation: 25
Derive your widget from QDialog instead of QWidget and call QDialog::setModal() or QDialog::exec().
By the way, a modal non-dialog window is some kind of misdesign.
Upvotes: 0
Reputation: 326
I'm not sure if I understand you right, but I think you have to call
yourWidget->setWindowModality(Qt::ApplicationModal)
(before showing your Widget) to get the Messagebox-like behaviour...
Upvotes: 2