PySide6.QtPdf.QPdfSelection

class QPdfSelection

QPdfSelection 类定义了在PDF文档的一页上选择的文本范围及其几何边界。更多

概要

属性

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

另请参阅

getSelection()

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property boundingRectangleᅟ: QRectF

此属性保存围绕bounds的整体边界矩形(凸包)。

Access functions:
property boundsᅟ: list of QPolygonF

此属性保存一组区域,这些区域是所选文本在页面上占据的位置,表示为多边形。多边形的坐标系原点位于页面的左上角,单位为

注意

目前,从getSelection()返回的多边形始终是矩形;但在未来,可能可以表示更复杂的区域。

Access functions:
property endIndexᅟ: int

此属性保存页面完整文本中text末尾的索引。

Access functions:
property startIndexᅟ: int

此属性保存页面完整文本中text开始处的索引。

Access functions:
property textᅟ: str

此属性保存选定的文本。

Access functions:
property validᅟ: bool

此属性表示选择是否有效。

Access functions:
__init__(other)
Parameters:

其他QPdfSelection

boundingRectangle()
Return type:

QRectF

属性 boundingRectangleᅟ 的获取器。

bounds()
Return type:

QPolygonF的列表

属性 boundsᅟ 的获取器。

copyToClipboard([mode=QClipboard.Clipboard])
Parameters:

modeMode

根据选择的mode,将text复制到系统剪贴板。

endIndex()
Return type:

整数

属性 endIndexᅟ 的获取器。

isValid()
Return type:

布尔

属性 validᅟ 的获取器。

startIndex()
Return type:

整数

属性 startIndexᅟ 的获取器。

swap(other)
Parameters:

其他QPdfSelection

text()
Return type:

字符串

属性 textᅟ 的获取器。