Unsolved Accept from child dialog closes hidden parent dialog.
-
Very simple situation. I am trying to hide parent dialog while a child (modal dialog) is active, but after I call accept from the child I get result from
parentDlg.exec() function.If parent dialog is not hidden then everything is as expected, I get a result of the child.exec() inside parent.
Why parent becomes closed indirectly from the code of the child?
-
Hi
please be aware of
https://doc.qt.io/qt-5/qguiapplication.html#quitOnLastWindowClosed-prop
If this property is true, the applications quits when the last visible primary window (i.e. window with no parent) is closed.so try to set to false and see if it still closes
-
Hi,
Beside the good point made by @mrjj, why are you hiding the parent dialog ?
-
@mrjj I didn't say application quits, My parent dialog return it's close code like I closed it, but I close the child.
@SGaist Structure of application very simple, I have login dialog and when I click "Ok" connection to server is in progress while user see progress dialog. And user can terminate progress and get back to Login dialog.
I know I can execute dialogs one by one, achieving the same result, but still, how to make it work as it is now.
( image url)
-
Please show the complete code related to that dialog handling.
-