summaryrefslogtreecommitdiffstats
path: root/src/pdf/quick/qquickpdfselection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf/quick/qquickpdfselection.cpp')
-rw-r--r--src/pdf/quick/qquickpdfselection.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pdf/quick/qquickpdfselection.cpp b/src/pdf/quick/qquickpdfselection.cpp
index d313820ba..5371e85e5 100644
--- a/src/pdf/quick/qquickpdfselection.cpp
+++ b/src/pdf/quick/qquickpdfselection.cpp
@@ -124,6 +124,22 @@ QVector<QPolygonF> QQuickPdfSelection::geometry() const
return m_geometry;
}
+void QQuickPdfSelection::selectAll()
+{
+ QPdfSelection sel = m_document->m_doc.getAllText(m_page);
+ if (sel.text() != m_text) {
+ m_text = sel.text();
+ if (QGuiApplication::clipboard()->supportsSelection())
+ sel.copyToClipboard(QClipboard::Selection);
+ emit textChanged();
+ }
+
+ if (sel.bounds() != m_geometry) {
+ m_geometry = sel.bounds();
+ emit geometryChanged();
+ }
+}
+
void QQuickPdfSelection::resetPoints()
{
bool wasHolding = m_hold;