QMessageBox won't close using setStandardButtons(0);
-
All,
I launch a standard QMessageBox using:
@
dialogBox = new QMessageBox( this );
dialogBox->setAttribute( Qt::WA_DeleteOnClose ); //makes sure the msgbox is deleted automatically when closed
dialogBox->setText("Device rebooting");
dialogBox->setInformativeText("Please wait for device to reboot.");
dialogBox->setStandardButtons(0);dialogBox->open( this, NULL);
@
but if I call:
@
dialogBox->close();
@Nothing happens, and the MessageBox will not close. However, If I include a standard button:
@msgBox->setStandardButtons(QMessageBox::Cancel); @It will close just fine with:
@dialogBox->close();@Any Ideas?
Thanks,
Terry -
Hi and welcome to devnet,
Can you try with done(0) ?
-
Done(0) works great!!
Thanks!
Terry -
You're welcome !
Since you have your message box working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)