I tried two things
1. Created the messageBox in the constructor and assigned parent to the main window
constructor()
{
messageBox->setWindowModality(Qt::ApplicationModal);
}
void slotFunction()
{
messageBox->setWindowTitle("....");
messageBox->setDetailedText("....");
messageBox->exec();
}
constructor()
{
messageBox = new QMessageBox(this);
messageBox->setWindowModality(Qt::ApplicationModal);
}
void slotFunction()
{
messageBox->setWindowTitle("....");
messageBox->setDetailedText("....");
messageBox->exec();
}
To copy to clipboard, switch view to plain text mode
This seems to solve the problem of multiple boxes opening. But still on furious clicking, flickering is observed in the message box as if one opened over another even though there is only one box opened in effect. Why should this behavior be there?
2. disable/enable the UI. The components become grayed out on disable. Sometime I observe that on closing the message box, the components take a while to return from grayed out state to normal state, which looks odd. Is there a way to control how a widget looks in disabled state?
Bookmarks