Run the initialization everytime you start a dialog
-
@Sucharek
This initialization happens each time a fresh instance of aDialog
is created, rather than at application start time.If you want a freshly initialized instance create one with
Dialog *dialog = new Dialog;
orDialog dialog;
as appropriate, instead of keeping the old instance you had around. -
@mpergand, I want to execute a command, when the dialog gets executed.
For more explanation, I'm executing a Qt designer form class. I make a dialog design, give it some functions, but everytime it gets executed, I need to update some variables, ui elements, etc., and I wanna do that everytime I execute it (everytime I do: dialog.exec()) -
@Sucharek
Depending on whether you create a newQDialog
each time you show it or you keep one around and re-use it, eitherPut what you want extra after
ui->setupUi(this);
inDialog::Dialog()
.Or do something like:
Dialog::doSomeStuffToTheUi() { ui->doSomething(); } // Outside world caller dialog.doSomeStuffToTheUi(); dialog.exec();
If that does not do what you want, you are either doing something wrong or you are not explaining what this fails to achieve.