mtnbiker66
2nd February 2012, 20:39
I'm currently passing data to a popup dialog in the following manner:
mainwindow.cpp
RAO_Edit = new RAOEntryDialog();
RAO_Edit->edit_rao(surgemodel);
RAO_Edit->exec();
RAOEntryDialog
void RAOEntryDialog::edit_rao(QSqlTableModel *process_model)
{
...
}
But I can also do it like this:
mainwindow.cpp
RAO_Edit = new RAOEntryDialog(surgemodel);
RAO_Edit->edit_rao();
RAO_Edit->exec();
RAOEntryDialog
RAOEntryDialog::RAOEntryDialog(QSqlTableModel *process_model, QWidget *parent) :
QDialog(parent),
ui(new Ui::RAOEntryDialog)
{
...
}
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
mainwindow.cpp
RAO_Edit = new RAOEntryDialog();
RAO_Edit->edit_rao(surgemodel);
RAO_Edit->exec();
RAOEntryDialog
void RAOEntryDialog::edit_rao(QSqlTableModel *process_model)
{
...
}
But I can also do it like this:
mainwindow.cpp
RAO_Edit = new RAOEntryDialog(surgemodel);
RAO_Edit->edit_rao();
RAO_Edit->exec();
RAOEntryDialog
RAOEntryDialog::RAOEntryDialog(QSqlTableModel *process_model, QWidget *parent) :
QDialog(parent),
ui(new Ui::RAOEntryDialog)
{
...
}
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