QMessageBox not able to close.
-
This post is deleted!
-
-
@Anas_Deshmukh
Although I doubt it will help your behaviour --- though worth a try --- you might like to replacethis->msgBox->close();
with something likethis->msgBox->reject();
orthis->msgBox->done(-1);
, to aid your caller. -
@Anas_Deshmukh
Like I said, I did not expect this change to help your issue now. But I think you will want it when you have your code working, since you test the result returned from the dialog.Never mind whether
this->msgBox->isEnabled()
is still true, does the dialog actually close or not? -
@Anas_Deshmukh
Well, I'd try inserting a single-shot timer for 1 second which will close the message box immediately before your.exec()
line, to eliminate whatever might be going on with your QML timer stuff. There are plenty of examples on the web of doing that for timed closure of a dialog. And/or change your.exec()
to.show()
(have to adjust your calling code) and see whether that makes it work. -
@JonB Hi, i fix the problem.
Issue i had is somehow in my project one new object were created (typical scenario), and function closePopUp() unable to access newly created instance as it always pointing previously created object.thaks for your time and consideration.