PdfSelection QML Type
A representation of a text selection within a PDF Document. More...
Import Statement: | import QtQuick.Pdf 5.15 |
Since: | Qt 5.15 |
Properties
- fromPoint : point
- geometry : list<list<point>>
- hold : bool
- page : int
- string : string
- toPoint : point
Methods
- void copyToClipboard()
Detailed Description
PdfSelection provides the text string and its geometry within a bounding box from one point to another.
Property Documentation
The beginning location, in points from the upper-left corner of the page, from which to find selected text. This can be bound to a scaled version of the centroid.pressPosition
of a DragHandler to begin selecting text from the position where the user presses the mouse button and begins dragging, for example.
A set of paths in a form that can be bound to the paths
property of a PathMultiline instance to render a batch of rectangles around the text regions that are included in the selection:
PdfDocument { id: doc } PdfSelection { id: selection document: doc fromPoint: textSelectionDrag.centroid.pressPosition toPoint: textSelectionDrag.centroid.position hold: !textSelectionDrag.active } Shape { ShapePath { PathMultiline { paths: selection.geometry } } } DragHandler { id: textSelectionDrag acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus target: null }
See also PathMultiline.
The ending location, in points from the upper-left corner of the page, from which to find selected text. This can be bound to a scaled version of the centroid.position
of a DragHandler to end selection of text at the position where the user is currently dragging the mouse, for example.
Method Documentation
Copies plain text from the string property to the system clipboard.