aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-11-08 21:35:11 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2017-11-09 07:36:20 +0000
commitc57ab694eca2e3d0bc6c7e8c01df8dce20c3631e (patch)
tree88a79586081c918a991972fa7a915acb21238117
parent25c5d830c95872630ca87d21a3d9e3a7e084e0db (diff)
Qt: Give focus to preference value in PreferenceEditorFrame
Select the preference value text and give focus when editing a single preference. Ping-Bug: 14191 Change-Id: I8d5f91c40118b9d74f1a65f5311aa92dfeb3e1b7 Reviewed-on: https://code.wireshark.org/review/24306 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r--ui/qt/preference_editor_frame.cpp8
-rw-r--r--ui/qt/preference_editor_frame.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/ui/qt/preference_editor_frame.cpp b/ui/qt/preference_editor_frame.cpp
index 267aee7..1ae604e 100644
--- a/ui/qt/preference_editor_frame.cpp
+++ b/ui/qt/preference_editor_frame.cpp
@@ -168,6 +168,14 @@ void PreferenceEditorFrame::rangeLineEditTextEdited(const QString &new_str)
}
}
+void PreferenceEditorFrame::showEvent(QShowEvent *event)
+{
+ ui->preferenceLineEdit->setFocus();
+ ui->preferenceLineEdit->selectAll();
+
+ AccordionFrame::showEvent(event);
+}
+
void PreferenceEditorFrame::on_modulePreferencesToolButton_clicked()
{
if (module_) {
diff --git a/ui/qt/preference_editor_frame.h b/ui/qt/preference_editor_frame.h
index d765ad1..3c1b6b9 100644
--- a/ui/qt/preference_editor_frame.h
+++ b/ui/qt/preference_editor_frame.h
@@ -48,6 +48,7 @@ signals:
void pushFilterSyntaxStatus(const QString&);
protected:
+ virtual void showEvent(QShowEvent *event);
void keyPressEvent(QKeyEvent *event);
private slots: