I wrote this to prevent the user from closing the main dialog and leaving other windows open:
if (QMessageBox::question(this, tr
("Close ALL windows?"),
{
qApp->closeAllWindows();
}
}
void Dialog::closeEvent(QCloseEvent *e) {
if (QMessageBox::question(this, tr("Close ALL windows?"),
tr("Close ALL windows?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
{
qApp->closeAllWindows();
}
}
To copy to clipboard, switch view to plain text mode
But when I click yes nothing happens and the program is blocked.
What I do wrong?
Bookmarks