Focus query editor when opening new querytab.

Close #7
This commit is contained in:
eelke 2018-04-21 14:36:33 +02:00
parent 8cb1d6eab3
commit d67224858d
3 changed files with 7 additions and 0 deletions

View file

@ -43,6 +43,7 @@ QueryTab* MainWindow::newSqlPage()
ui->tabWidget->addTab(qt, "Tab");
ui->tabWidget->setCurrentWidget(qt);
qt->newdoc();
qt->focusEditor();
return qt;
}

View file

@ -598,3 +598,8 @@ void QueryTab::exportData(const QString &file_name)
rw->exportData(file_name);
}
}
void QueryTab::focusEditor()
{
ui->queryEdit->setFocus();
}

View file

@ -60,6 +60,7 @@ public:
QString fileName() const { return m_fileName; }
bool isChanged() const { return m_queryTextChanged; }
bool isNew() const { return m_new; }
void focusEditor();
private:
using ResultTabContainer = std::vector<TuplesResultWidget*>;