Answer the question
In order to leave comments, you need to log in
Which method tells the QWidget not to disappear after being displayed by the show() method?
I create a new QWidget window from the main window class, when I click the corresponding item in the menu, the Qwidget window is displayed and immediately closes, how can I fix this? I call like this
OptionApp OptionDialog;
OptionDialog.show();
Answer the question
In order to leave comments, you need to log in
You are doing something wrong.
In this case, you create an object of the OptionApp class on the stack, which means that after the function exits, it will be destroyed. Correct to
OptionApp *optionDialog = new OptionApp(this);
optionDialog->show();
OptionDialog.exec();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question