Make sure the SQL editor has got the focus after creating a new tab

Focus the SQL editor of a newly created tab to make sure it receives
keyboard input without need to click it first. On my system this wasn't
the case after starting the application, i.e. the first time the SQL tab
is used.
This commit is contained in:
Martin Kleusberg
2014-05-11 13:46:28 +02:00
parent 770a37928b
commit ddda08b673

View File

@@ -1161,6 +1161,7 @@ unsigned int MainWindow::openSqlTab(bool resetCounter)
w->getEditor()->insertFieldCompleterModels(completerModelsFields);
int index = ui->tabSqlAreas->addTab(w, QString("SQL %1").arg(++tabNumber));
ui->tabSqlAreas->setCurrentIndex(index);
w->getEditor()->setFocus();
return index;
}