From 075c0d8be4a72e813c4c81e147af317aad129119 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?= Date: Sat, 27 Oct 2012 09:30:31 +0700 Subject: [PATCH 1/1] Auto focus to word input. --- mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mainwindow.cpp b/mainwindow.cpp index c88c514..35db3e5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -45,6 +45,7 @@ void MainWindow::setupcodedUI() // Clear the word input when Clear button is tapped QObject::connect(btnClear, SIGNAL(clicked()), wordinput, SLOT(clear())); QObject::connect(btnClear, SIGNAL(clicked()), labVerb, SLOT(clear())); + QObject::connect(btnClear, SIGNAL(clicked()), wordinput, SLOT(setFocus())); QObject::connect(wordinput, SIGNAL(returnPressed()), this, SLOT(startLookup())); QObject::connect(btnLookup, SIGNAL(clicked()), this, SLOT(startLookup())); @@ -107,6 +108,7 @@ void MainWindow::showExpanded() #else show(); #endif + wordinput->setFocus(); } void MainWindow::startLookup() -- 1.7.9.5