QAbstractTextDocumentLayout::PaintContext Struct

struct QAbstractTextDocumentLayout::PaintContext

QAbstractTextDocumentLayout::PaintContext 类是一个方便的类,用于定义绘制文档布局时使用的参数。更多

公共变量

QRectF clip
int cursorPosition
QPalette palette
QList<QAbstractTextDocumentLayout::Selection> selections

详细说明

使用QAbstractTextDocumentLayout::draw() 函数为 QTextDocuments 渲染自定义布局时,会用到绘制上下文。它由cursor position,default text color,clip 矩形和selections 集合指定。

另请参阅 QAbstractTextDocumentLayout

成员变量文档

QRectF PaintContext::clip

该变量为版面设计提供提示,指定段落、框架或文本周围需要绘制的区域。

该矩形外的所有内容都无需绘制。

指定剪贴矩形可以大大加快大型文档的绘制速度。请注意,剪贴矩形是文档坐标(而不是视口坐标)。它不能替代绘制器上设置的剪辑区域,而只是一个提示。

默认值为空矩形,表示需要绘制所有内容。

int PaintContext::cursorPosition

该变量用于保存光标线在文档中的位置。

默认值为-1。

QPalette PaintContext::palette

该变量用于保存未指定颜色时文本使用的默认颜色。

默认值是应用程序的默认调色板。

QList<QAbstractTextDocumentLayout::Selection> PaintContext::selections

该变量用于保存将此油漆上下文传递给QAbstractTextDocumentLayoutdraw() 函数时将呈现的选择集合。

默认值为空列表,表示没有选择。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.