I'm currently passing data to a popup dialog in the following manner:

mainwindow.cpp
Qt Code:
  1. RAO_Edit = new RAOEntryDialog();
  2. RAO_Edit->edit_rao(surgemodel);
  3. RAO_Edit->exec();
To copy to clipboard, switch view to plain text mode 

RAOEntryDialog
Qt Code:
  1. void RAOEntryDialog::edit_rao(QSqlTableModel *process_model)
  2. {
  3. ...
  4. }
To copy to clipboard, switch view to plain text mode 

But I can also do it like this:
mainwindow.cpp
Qt Code:
  1. RAO_Edit = new RAOEntryDialog(surgemodel);
  2. RAO_Edit->edit_rao();
  3. RAO_Edit->exec();
To copy to clipboard, switch view to plain text mode 

RAOEntryDialog
Qt Code:
  1. RAOEntryDialog::RAOEntryDialog(QSqlTableModel *process_model, QWidget *parent) :
  2. QDialog(parent),
  3. ui(new Ui::RAOEntryDialog)
  4. {
  5. ...
  6. }
To copy to clipboard, switch view to plain text mode 

It's not necessary but I'd like to be able to operate on this model from several of the methods within my RAOEntryDialog class and that's got me a little perplexed as to how, so is there one way of getting the model into the dialog better than the other? This is a QSqlTableModel and I'm planning on transferring the data to a QTableWidget to allow me to treat the data in a spreadsheet fashion (insert, delete, copy, paste), then pass the data back to my mainwindow via signal/slot mechanism...

Thanks!


Kodi