diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-12-29 12:54:32 -0700 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-01-07 01:42:59 +0000 |
commit | d9cf674ed9fe682d4b3bec8eff81e381c7251d68 (patch) | |
tree | 65956833990a512fdfaf8270489271a88f461f17 /examples | |
parent | 0ada5385d4020479f511179f0fcd605cbe8296a4 (diff) |
PDF Quick examples: select text in search field when pressing Ctrl-F
It's better for usability in case the user is doing repeated searches:
press control-F and start typing to search for different text, rather
than needing to do something else to select or delete the existing
text in the search field.
Fixes: QTBUG-120447
Pick-to: 6.5 6.2
Change-Id: I8d5a519a631c406dff91198b23a022856609fa4c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 140edbd6c887c0ae26a054d8c859041c68f06fd7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 274fb4698fa06cf513ce48b71a4f59d3e1608a3c)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pdf/multipage/viewer.qml | 5 | ||||
-rw-r--r-- | examples/pdf/pdfviewer/viewer.qml | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml index d0b0a7263..9a3ca6bad 100644 --- a/examples/pdf/multipage/viewer.qml +++ b/examples/pdf/multipage/viewer.qml @@ -127,7 +127,10 @@ ApplicationWindow { } Shortcut { sequence: StandardKey.Find - onActivated: searchField.forceActiveFocus() + onActivated: { + searchField.forceActiveFocus() + searchField.selectAll() + } } Shortcut { sequence: StandardKey.Quit diff --git a/examples/pdf/pdfviewer/viewer.qml b/examples/pdf/pdfviewer/viewer.qml index a62035166..1745b70d9 100644 --- a/examples/pdf/pdfviewer/viewer.qml +++ b/examples/pdf/pdfviewer/viewer.qml @@ -129,7 +129,10 @@ ApplicationWindow { } Shortcut { sequence: StandardKey.Find - onActivated: searchField.forceActiveFocus() + onActivated: { + searchField.forceActiveFocus() + searchField.selectAll() + } } Shortcut { sequence: StandardKey.Quit |