Unsolved MessageWindow
-
MessageWindow->show() and MessageWindow->exec() difference ? and where would what be appropriate to use ?
-
@radhikak1394 I guess you mean QMessageBox (there is no class called MessageWindow in Qt)?
If so why not go to the documentation?
exec(): http://doc.qt.io/qt-5/qmessagebox.html#exec - it shows the dialog as a modal dialog. This means main window is blocked and only message box can be used (it stays in foreground).show(): http://doc.qt.io/qt-5/qwidget.html#show - shows the dialog in non modal mode. Means: all application windows/dialogs can be used and this message box can go to the background.
Appropriate use depends on your needs. If you want to show a message box and prevent the user from using the app before closing the box then use exec(), else use show()...
-
@jsulm Thanks for the above response. So exec() is returning Rejected(0) , and the popup seems to vanish without user's response. could you help me with this ?
-
@radhikak1394
QMessageBox::exec()
(orQDialog
, or whatever it is you are actually using?) will not return anything or vanish on its own (docs: "Shows the message box as a modal dialog, blocking until the user closes it."). Show your relevant code for creating/handling your "message box"?