PySide6.QtPdf.QPdfSelection¶
- class QPdfSelection¶
QPdfSelection类定义了在PDF文档的一页上选择的文本范围及其几何边界。更多…概要¶
属性¶
方法¶
def
__init__()def
bounds()def
endIndex()def
isValid()def
startIndex()def
swap()def
text()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
另请参阅
注意
当使用
from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。此属性保存围绕
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ᅟ的获取器。属性
boundsᅟ的获取器。根据选择的
mode,将text复制到系统剪贴板。- endIndex()¶
- Return type:
整数
属性
endIndexᅟ的获取器。- isValid()¶
- Return type:
布尔
属性
validᅟ的获取器。- startIndex()¶
- Return type:
整数
属性
startIndexᅟ的获取器。- swap(other)¶
- Parameters:
其他 –
QPdfSelection
- text()¶
- Return type:
字符串
属性
textᅟ的获取器。