QTextItem Class

QTextItem クラスは、カスタムペイントエンジンでテキストを描画するために必要なすべての情報を提供します。詳細...

ヘッダー #include <QTextItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

パブリックな型

enum RenderFlag { RightToLeft, Overline, Underline, StrikeOut }
flags RenderFlags

パブリック関数

qreal ascent() const
qreal descent() const
QFont font() const
QTextItem::RenderFlags renderFlags() const
QString text() const
qreal width() const

詳細説明

独自のペイントエンジンを再実装する場合、QPaintEngine::drawTextItem()を再実装する必要があります。この関数は、QTextItemを引数の1つとして受け取ります。

メンバ型ドキュメント

enum QTextItem::RenderFlag
flags QTextItem::RenderFlags

定数説明
QTextItem::RightToLeft0x1テキストを右から左にレンダリングします。
QTextItem::Overline0x10テキストの上に線を描画します。
QTextItem::Underline0x20テキストの下に線を描画します。
QTextItem::StrikeOut0x40テキストを通る線を描画する。

RenderFlags型はQFlags<RenderFlag>のtypedefです。これは、RenderFlag値のORの組み合わせを格納します。

メンバ関数ドキュメント

qreal QTextItem::ascent() const

描画されるテキストのascent

qreal QTextItem::descent() const

描画されるテキストのdescent

QFont QTextItem::font() const

テキストの描画に使用するフォントを返します。

QTextItem::RenderFlags QTextItem::renderFlags() const

使用されているレンダーフラグを返します。

QString QTextItem::text() const

描画するテキストを返します。

qreal QTextItem::width() const

描画するテキストの全幅を指定する。

© 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.