From 57672f6d8389635ff4a7e55853da501816d2ad37 Mon Sep 17 00:00:00 2001 From: Vladislav Tronko Date: Mon, 15 Aug 2016 10:32:03 +0300 Subject: [PATCH] Cut off redundant expensive constructions --- src/MainWindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index c97414fc..ddfdaabb 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -366,6 +366,9 @@ void MainWindow::populateTable(QString tablename) // Remove the model-view link if the table name is empty in order to remove any data from the view if(ui->comboBrowseTable->model()->rowCount() == 0 && tablename.isEmpty()) { + if (!ui->dataTable->model()) + return; + ui->dataTable->setModel(0); if(qobject_cast(ui->dataTable->horizontalHeader())) qobject_cast(ui->dataTable->horizontalHeader())->generateFilters(0);