diff --git a/sources/mainwindow.cpp b/sources/mainwindow.cpp
index 2e62a5f..30ff54f 100644
--- a/sources/mainwindow.cpp
+++ b/sources/mainwindow.cpp
@@ -13,6 +13,9 @@ MainWindow::MainWindow(QWidget *parent)
resultTable = ui->resultTable;
+ resultTableModel = new SQMTableModel;
+// resultTable->setModel(resultTableModel);
+// resultTable->show();
connect(spinBase, SIGNAL(valueChanged(int)), this, SLOT(SetModel()));
connect(spinExp, SIGNAL(valueChanged(int)), this, SLOT(SetModel()));
@@ -31,9 +34,8 @@ void MainWindow::SetModel() {
int exp = spinExp->value();
int mod = spinMod->value();
- SQMTableModel resultTableModel;
- resultTableModel.SetStartValues(base, exp, mod);
- resultTable->setModel(&resultTableModel);
+ resultTableModel->SetStartValues(base, exp, mod);
+ resultTable->setModel(resultTableModel);
//resultTable->show();
}
diff --git a/sources/mainwindow.h b/sources/mainwindow.h
index f8a6f65..92f2e67 100644
--- a/sources/mainwindow.h
+++ b/sources/mainwindow.h
@@ -27,7 +27,7 @@ private:
Ui::MainWindow *ui;
QSpinBox *spinBase, *spinExp, *spinMod;
QTableView *resultTable;
- //SQMTableModel *resultTableModel;
+ SQMTableModel *resultTableModel;
};
#endif // MAINWINDOW_H
diff --git a/sources/mainwindow.ui b/sources/mainwindow.ui
index 969ba6f..e44f1a5 100644
--- a/sources/mainwindow.ui
+++ b/sources/mainwindow.ui
@@ -65,6 +65,9 @@
421
+
+ false
+