diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-10 12:57:32 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-11 08:31:44 +0100 |
commit | 5dc78ed4e2891205a7162b696b3439a87253140f (patch) | |
tree | 09778a7d19015f627be5efa813bf4730a82c1ed1 /src/pdf/quick/qml/PdfMultiPageView.qml | |
parent | f253884934cbdbc16fd9b783a2b115960d11af10 (diff) |
PdfSelection: add selectAll() function; use in examples
The usual shortcut (control-A) now selects all text on the current page,
it is highlighted, and it can be copied to the clipboard.
Change-Id: I5e6d9cae675862808f8b9027cb47024ca65cf2fd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/pdf/quick/qml/PdfMultiPageView.qml')
-rw-r--r-- | src/pdf/quick/qml/PdfMultiPageView.qml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pdf/quick/qml/PdfMultiPageView.qml b/src/pdf/quick/qml/PdfMultiPageView.qml index 579c9a1ce..70bb5454f 100644 --- a/src/pdf/quick/qml/PdfMultiPageView.qml +++ b/src/pdf/quick/qml/PdfMultiPageView.qml @@ -47,6 +47,11 @@ Item { property bool debug: false property string selectedText + function selectAll() { + var currentItem = tableView.itemAtPos(0, tableView.contentY + root.height / 2) + if (currentItem !== null) + currentItem.selection.selectAll() + } function copySelectionToClipboard() { var currentItem = tableView.itemAtPos(0, tableView.contentY + root.height / 2) if (debug) |