Skip to content

Commit

Permalink
Adjust DbQueryWidget selection only if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Aug 20, 2018
1 parent 8e59c5b commit 1357fd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gui/dbquerywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ void DbQueryWidget::showResults()
if (m_model->results().isEmpty()) {
m_ui->applyPushButton->setEnabled(false);
} else {
m_ui->resultsTreeView->selectionModel()->setCurrentIndex(
m_model->index(0, 0), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
auto *const selectionModel(m_ui->resultsTreeView->selectionModel());
if (selectionModel->selection().isEmpty()) {
selectionModel->setCurrentIndex(m_model->index(0, 0), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}
m_ui->applyPushButton->setEnabled(m_tagEditorWidget->activeTagEdit());
}
setStatus(true);
Expand Down

0 comments on commit 1357fd1

Please sign in to comment.