...
form_login l;
{
tmain_form main_form;
main_form.show();
return a.exec();
}
...
...
form_login l;
if (l.exec() == QDialog::Accepted)
{
tmain_form main_form;
main_form.show();
return a.exec();
}
...
To copy to clipboard, switch view to plain text mode
Hi I'm using this code to show a login form on the main.cpp file.
When used in this way before the a.exec(), everything works fine.
But when I try this, the exec() is not executed in the usual way, the dialog is closed not waiting for user action.
tcontrol *control = new tcontrol();
if (control->login())
{
tmain_form main_form;
main_form.show();
return a.exec();
}
tcontrol *control = new tcontrol();
if (control->login())
{
tmain_form main_form;
main_form.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
and login is just a method wrapping the first code, returning (l.exec() == QDialog::Accepted)
What is the difference?
I'm missing something?
Thanks in advance.
Bookmarks