QAbstractTextDocumentLayout::PaintContext Struct
struct QAbstractTextDocumentLayout::PaintContextQAbstractTextDocumentLayout::PaintContext クラスは、ドキュメントのレイアウトを描画する際に使用されるパラメータを定義する利便性クラスです。詳細...
パブリック変数
| QRectF | clip |
| int | cursorPosition |
| QPalette | palette |
| QList<QAbstractTextDocumentLayout::Selection> | selections |
詳細な説明
ペイントコンテキストは、QAbstractTextDocumentLayout::draw() 関数を使用して QTextDocument のカスタムレイアウトをレンダリングする際に使用されます。これは、cursor position 、default text color 、clip の矩形およびselections のコレクションによって指定されます。
QAbstractTextDocumentLayoutも参照してください 。
メンバ変数のドキュメント
QRectF PaintContext::clip
この変数には、段落、フレーム、またはテキストの周囲で描画が必要な領域を指定する、レイアウトに関するヒントが格納されています。
この矩形の外側にある部分は、描画する必要がありません。
クリップ矩形を指定することで、大規模なドキュメントの描画速度を大幅に向上させることができます。なお、クリップ矩形はドキュメント座標系(ビューポート座標系ではない)で指定されることに注意してください。これは、ペインターに設定されたクリップ領域の代わりとなるものではなく、あくまでヒントに過ぎません。
デフォルト値は、すべてを描画する必要があることを示す、空の矩形です。
int PaintContext::cursorPosition
この変数には、ドキュメント内のカーソルラインを描画すべき位置が格納されます。
デフォルト値は -1 です。
QPalette PaintContext::palette
この変数には、色が指定されていない場合にテキストに使用されるデフォルトの色が格納されます。
デフォルト値は、アプリケーションのデフォルトパレットです。
QList<QAbstractTextDocumentLayout::Selection> PaintContext::selections
この変数には、このペイントコンテキストをQAbstractTextDocumentLayout のdraw()関数に渡した際にレンダリングされる選択項目のコレクションが格納されます。
デフォルト値は、選択がないことを示す空のリストです。
© 2026 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.