Auto focus to word input.
authorNguyễn Hồng Quân <ng.hong.quan@gmail.com>
Sat, 27 Oct 2012 02:30:31 +0000 (09:30 +0700)
committerNguyễn Hồng Quân <ng.hong.quan@gmail.com>
Sat, 27 Oct 2012 02:30:31 +0000 (09:30 +0700)
mainwindow.cpp

index c88c514..35db3e5 100644 (file)
@@ -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()