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();
RAO_Edit = new RAOEntryDialog();
RAO_Edit->edit_rao(surgemodel);
RAO_Edit->exec();
To copy to clipboard, switch view to plain text mode
RAOEntryDialog
{
...
}
void RAOEntryDialog::edit_rao(QSqlTableModel *process_model)
{
...
}
To copy to clipboard, switch view to plain text mode
But I can also do it like this:
mainwindow.cpp
RAO_Edit = new RAOEntryDialog(surgemodel);
RAO_Edit->edit_rao();
RAO_Edit->exec();
RAO_Edit = new RAOEntryDialog(surgemodel);
RAO_Edit->edit_rao();
RAO_Edit->exec();
To copy to clipboard, switch view to plain text mode
RAOEntryDialog
ui(new Ui::RAOEntryDialog)
{
...
}
RAOEntryDialog::RAOEntryDialog(QSqlTableModel *process_model, QWidget *parent) :
QDialog(parent),
ui(new Ui::RAOEntryDialog)
{
...
}
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
Bookmarks