From: "Peter Kümmel" <syntheticpp@gmx.net>
To: linux-kernel@vger.kernel.org
Cc: "Peter Kümmel" <syntheticpp@gmx.net>
Subject: [PATCH] xconfig: Set keyboard focus to line edit whenever the search dialog opens
Date: Thu, 6 Nov 2014 13:03:03 +0100 [thread overview]
Message-ID: <1415275383-15301-4-git-send-email-syntheticpp@gmx.net> (raw)
In-Reply-To: <1415275383-15301-1-git-send-email-syntheticpp@gmx.net>
When after a search on a result is clicked the focus jumps to
the result list. So after closing and reopening the dialog the
field does not have the focus any more. This is annoying when
you press Ctrl-F and start typing for a new search because
the text shows not up in the edit field but gets lost. You
have to click additionally into the edit field to move the
focus to this field. With this patch the focus is always set
to the edit field when the dialog opens.
Signed-off-by: Peter Kümmel <syntheticpp@gmx.net>
---
scripts/kconfig/qconf.cc | 6 ++++++
scripts/kconfig/qconf.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 9d3b04b..7ef498d 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1235,6 +1235,11 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
}
}
+void ConfigSearchWindow::setFocusOnLineEdit()
+{
+ editField->setFocus(Qt::OtherFocusReason);
+}
+
void ConfigSearchWindow::saveSettings(void)
{
if (name()) {
@@ -1506,6 +1511,7 @@ void ConfigMainWindow::searchConfig(void)
if (!searchWindow)
searchWindow = new ConfigSearchWindow(this, "search");
searchWindow->show();
+ searchWindow->setFocusOnLineEdit();
}
void ConfigMainWindow::changeMenu(struct menu *menu)
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index bde0c6b..6f2c4d6 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -288,6 +288,7 @@ public:
public slots:
void saveSettings(void);
void search(void);
+ void setFocusOnLineEdit(void);
protected:
QLineEdit* editField;
--
1.9.1
next prev parent reply other threads:[~2014-11-06 12:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 12:03 [PATCH] kconfig: Fix warning "‘jump’ may be used uninitialized" Peter Kümmel
2014-11-06 12:03 ` [PATCH] xconfig: Don't move focus when clicking on the search button Peter Kümmel
2014-11-06 12:03 ` [PATCH] xconfig: Set configuration strings on focus lost Peter Kümmel
2014-11-06 12:03 ` Peter Kümmel [this message]
2014-11-06 12:36 ` [PATCH] kconfig: Fix warning "‘jump’ may be used uninitialized" Paul Bolle
2014-11-06 14:13 ` Aw: " Peter Kuemmel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415275383-15301-4-git-send-email-syntheticpp@gmx.net \
--to=syntheticpp@gmx.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®