diff options
author | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-08-09 18:09:47 +0200 |
---|---|---|
committer | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-08-09 18:09:47 +0200 |
commit | 4464e14e20baf3cbb21d9f3109c6df0db3e9b472 (patch) | |
tree | 67a7888f5f39bb23651819957a8fa072257f0f30 | |
parent | 46adda757996e3ca9b2c340f6a177ff54bb603b7 (diff) |
fixes https://github.com/IJHack/qtpass/issues/89
-rw-r--r-- | mainwindow.cpp | 11 | ||||
-rw-r--r-- | mainwindow.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 182d4aad..34ba2256 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -49,6 +49,13 @@ MainWindow::MainWindow(QWidget *parent) : QApplication::quit(); } QtPass = NULL; + QTimer::singleShot(10, this, SLOT(focusInput())); + +} + +void MainWindow::focusInput() { + ui->lineEdit->selectAll(); + ui->lineEdit->setFocus(); } /** @@ -338,7 +345,6 @@ bool MainWindow::checkConfig() { ui->pushButton->show(); ui->updateButton->show(); } - ui->lineEdit->setFocus(); startupPhase = false; return true; @@ -1325,8 +1331,7 @@ void MainWindow::setApp(SingleApplication *app) void MainWindow::messageAvailable(QString message) { if (message.isEmpty()) { - ui->lineEdit->selectAll(); - ui->lineEdit->setFocus(); + focusInput(); } else { ui->treeView->expandAll(); ui->lineEdit->setText(message); diff --git a/mainwindow.h b/mainwindow.h index 5ff48ea6..f7dad7e7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -75,6 +75,7 @@ private slots: void showContextMenu(const QPoint& pos); void addFolder(); void editPassword(); + void focusInput(); private: QApplication *QtPass; |