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...

Qt Code:
  1. void on_push_0_clicked()
  2. {
  3. KeyDialog dialog(this); //Create dialog
  4. dialog.setKey(zero); //use setKey function of dialog
  5. dialog.exec(); //Show dialog
  6. }
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.

Qt Code:
  1. void KeyDialog::on_buttonBox_accepted()
  2. {
  3. //Copy key for safety
  4. Key::Key K2 = K1; //K1 is a global instance that is processed earlier in the form
  5. //add new data from form
  6. //changes vars in K2
  7. mainWin.resetKey(K2); //sends K2 back to mainwindow
  8. }
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