QTextInlineObject Class

QTextInlineObject クラスは、QAbstractTextDocumentLayout のインラインオブジェクトとその実装を表します。詳細...

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

注意:このクラスの関数はすべてリエントラントです。

パブリック関数

qreal ascent() const
qreal descent() const
QTextFormat format() const
int formatIndex() const
qreal height() const
bool isValid() const
QRectF rect() const
void setAscent(qreal a)
void setDescent(qreal d)
void setWidth(qreal w)
Qt::LayoutDirection textDirection() const
int textPosition() const
qreal width() const

詳細説明

通常、QTextInlineObject を作成する必要はありません。これは、QAbstractTextDocumentLayout 、カスタムレイアウトを実装する際にインラインオブジェクトを処理するために使用されます。

インライン・オブジェクトは、例えばsetWidth(),setAscent(),setDescent() を使って設定できる様々な属性を持っています。インライン・オブジェクトが占める矩形はrect() で、その方向はtextDirection() で与えられます。テキストレイアウト内での位置はtextPosition() で、書式はformat() で指定します。

メンバ関数ドキュメント

qreal QTextInlineObject::ascent() const

インライン・オブジェクトの上昇を返す。

setAscent()、descent()、width() およびrect()も参照

qreal QTextInlineObject::descent() const

インライン・オブジェクトの降下を返します。

setDescent(),ascent(),width(),rect()も参照

QTextFormat QTextInlineObject::format() const

テキストレイアウト内のインラインオブジェクトのフォーマットを返します。

int QTextInlineObject::formatIndex() const

テキストレイアウト内のインラインオブジェクトのフォーマットを表す整数を返します。

qreal QTextInlineObject::height() const

インラインオブジェクトの全高を返す。これはascent() +descent() + 1 に等しい。

ascent()、descent()、width()、rect()も参照

bool QTextInlineObject::isValid() const

このインラインオブジェクトが有効であればtrue を返し、そうでなければ false を返す。

QRectF QTextInlineObject::rect() const

インラインオブジェクトの矩形を返します。

ascent()、descent() およびwidth()も参照

void QTextInlineObject::setAscent(qreal a)

インライン・オブジェクトのアセントをa に設定する。

ascent(),setDescent(),width(),rect()も参照のこと

void QTextInlineObject::setDescent(qreal d)

インライン・オブジェクトの下降をd に設定する。

descent(),setAscent(),width(),rect()も参照のこと

void QTextInlineObject::setWidth(qreal w)

インライン・オブジェクトの幅をw に設定する。

width(),ascent(),descent(),rect()も参照

Qt::LayoutDirection QTextInlineObject::textDirection() const

オブジェクトを右から左にレイアウトするか、左から右にレイアウトするかを返します。

int QTextInlineObject::textPosition() const

テキストレイアウト内でのインラインオブジェクトの位置。

qreal QTextInlineObject::width() const

インラインオブジェクトの幅を返します。

setWidth()、ascent()、descent() およびrect()も参照

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