hello everyone,
i have this application when the main window (a QWidget) calls a child QDialog that is generated to configure some setting.. the quit button for the application is also on that same QDialog form and i can set things up in such a way that quit button is connected to the QDialog::reject() function (QDialog::accept() just closes the QDialog, saving the seetings and returns focus to the main window). the code on the main window looks like
menu =new menuForm(this,"aMenuForm",FALSE,(Qt::WStyle_Customize | Qt::WStyle_NoBorder));
if (menu
->exec
()==QDialog::Rejected) {
saveData();
//delete menu;
close(); //closes the main window
}
delete menu;
menu =new menuForm(this,"aMenuForm",FALSE,(Qt::WStyle_Customize | Qt::WStyle_NoBorder));
if (menu->exec()==QDialog::Rejected)
{
saveData();
//delete menu;
close(); //closes the main window
}
delete menu;
To copy to clipboard, switch view to plain text mode
so menu is executed and a reject call is sent the program must save the data and CLOSE the main form too...
ok now this works BUT what does not work is
mainForm::destroy()
{saveData();
}
mainForm::destroy()
{saveData();
}
To copy to clipboard, switch view to plain text mode
cause iin the beginning i was trying to get this to work by calling saveData() on mainForm::destroy()... but it did not run... why not?
thank you in advance for your help.
nass
Bookmarks