Cut off redundant expensive constructions

This commit is contained in:
Vladislav Tronko
2016-08-15 10:32:03 +03:00
parent 8f85a94049
commit 57672f6d83

View File

@@ -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<FilterTableHeader*>(ui->dataTable->horizontalHeader()))
qobject_cast<FilterTableHeader*>(ui->dataTable->horizontalHeader())->generateFilters(0);