Hello again,
I have a main window that opens a dialog when a button is pressed.
When this happens it sends an instance of a class to the dialog for processing like so...
void on_push_0_clicked()
{
KeyDialog dialog(this); //Create dialog
dialog.setKey(zero); //use setKey function of dialog
dialog.exec(); //Show dialog
}
void on_push_0_clicked()
{
KeyDialog dialog(this); //Create dialog
dialog.setKey(zero); //use setKey function of dialog
dialog.exec(); //Show dialog
}
To copy to clipboard, switch view to plain text mode
(Michiel helped me with that one)
Now I want to send the processed instance back to the main window.
void KeyDialog::on_buttonBox_accepted()
{
//Copy key for safety
Key::Key K2 = K1; //K1 is a global instance that is processed earlier in the form
//add new data from form
//changes vars in K2
mainWin.resetKey(K2); //sends K2 back to mainwindow
}
void KeyDialog::on_buttonBox_accepted()
{
//Copy key for safety
Key::Key K2 = K1; //K1 is a global instance that is processed earlier in the form
//add new data from form
//changes vars in K2
mainWin.resetKey(K2); //sends K2 back to mainwindow
}
To copy to clipboard, switch view to plain text mode
But I guess my dialog has no knowledge of MainWindow because it says it hasn't been declared. How do I go about accesing this member function of MainWindow?
Thank you all very much for your help,
Backslash
Bookmarks