From 0a2bc3a119bd105d5f338faedc96962ee9395212 Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 13 Oct 2010 13:58:32 +0000 Subject: added cpr lineedit focus functionality to ease use with keyboard --- client/launcherwindow.cc | 8 +++++++- client/launcherwindow.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/launcherwindow.cc b/client/launcherwindow.cc index e1c62eb..68f8e50 100644 --- a/client/launcherwindow.cc +++ b/client/launcherwindow.cc @@ -45,9 +45,9 @@ absolutePath() + "/templates.ini", QSettings::IniFormat); QLabel *cprLabel = new QLabel(tr("Patient ID:")); cprLineEdit = new QLineEdit(); cprLineEdit->setValidator(new QRegExpValidator(QRegExp("^[0-9]{10,10}$"), this)); - QLabel *templatesLabel = new QLabel(tr("Template:")); templates = new QComboBox(); + connect(templates, SIGNAL(currentIndexChanged(int)), this, SLOT(focusCpr(int))); QStringList groups = templateConfig.childGroups(); QStringList::iterator i = groups.begin(); while(i != groups.end()) { @@ -93,6 +93,7 @@ absolutePath() + "/templates.ini", QSettings::IniFormat); } setLayout(layout); + cprLineEdit->setFocus(); } LauncherWindow::~LauncherWindow() @@ -108,3 +109,8 @@ QString LauncherWindow::getTemplate() { return templates->itemData(templates->currentIndex()).toString(); } + +void LauncherWindow::focusCpr(int) +{ + cprLineEdit->setFocus(); +} diff --git a/client/launcherwindow.h b/client/launcherwindow.h index fc7670f..234a016 100644 --- a/client/launcherwindow.h +++ b/client/launcherwindow.h @@ -42,6 +42,9 @@ public: QString getCpr(); QString getTemplate(); +private slots: + void focusCpr(int); + private: QLineEdit *cprLineEdit; QComboBox *templates; -- cgit v1.2.3