From 810a6a5aa75f9b4b04cd26be534111ec61682b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20W=C3=B3jtowicz?= Date: Sun, 3 Sep 2017 19:04:05 +0200 Subject: [PATCH] Fixed table view Tab switch; Fixed removing unused data model --- src/mainwindow.cpp | 4 ++++ src/mainwindow.ui | 24 +++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 49161c1..ef00df1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -166,6 +166,8 @@ void MainWindow::disconnectFromServerRequested() { ui->button_connect->setEnabled(false); + delete ui->tableView_database_table->model(); + emit disconnectFromServer(); } @@ -197,6 +199,8 @@ void MainWindow::showTableRequested() { ui->button_show_table->setEnabled(false); + delete ui->tableView_database_table->model(); // remove old model + QString table_name = ui->comboBox_table_name->currentText(); emit selectTable(table_name); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 8b57b3a..c353b38 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -522,7 +522,29 @@ - + + + + 0 + 0 + + + + QAbstractItemView::NoEditTriggers + + + false + + + false + + + true + + + false + +