From c57ab694eca2e3d0bc6c7e8c01df8dce20c3631e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 8 Nov 2017 21:35:11 +0100 Subject: Qt: Give focus to preference value in PreferenceEditorFrame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- ui/qt/preference_editor_frame.cpp | 8 ++++++++ ui/qt/preference_editor_frame.h | 1 + 2 files changed, 9 insertions(+) diff --git a/ui/qt/preference_editor_frame.cpp b/ui/qt/preference_editor_frame.cpp index 267aee7d05..1ae604ec52 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 d765ad1465..3c1b6b9463 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: -- cgit v1.2.3