QTextObject Class

QTextObject クラスは、QTextDocument の一部をグループ化できる、さまざまな種類のオブジェクトの基本クラスです。詳細...

ヘッダー #include <QTextObject>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
を継承する: QObject
によって継承される:

QTextBlockGroup そしてQTextFrame

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

パブリック関数

QTextDocument *document() const
QTextFormat format() const
int formatIndex() const
int objectIndex() const

保護された関数

QTextObject(QTextDocument *document)
virtual ~QTextObject()
void setFormat(const QTextFormat &format)

詳細説明

一般的なグループ化テキストオブジェクトは、リスト(QTextList)、フレーム(QTextFrame)、テーブル(QTextTable)です。テキスト・オブジェクトには、関連するformat() とdocument() があります。

テキスト・オブジェクトには基本的に2種類あります:ブロックと一緒に使われるもの(ブロック・フォーマット)と、文字と一緒に使われるもの(キャラクタ・フォーマット)です。前者はQTextBlockGroup から、後者はQTextFrame から派生したものです。

このクラスを直接使う必要はほとんどありません。カスタムテキストオブジェクトを作成する場合は、QTextDocument::createObject ()を再実装する必要があります。 ()は、テキストオブジェクトを作成するためのファクトリーメソッドとして動作します。

QTextDocumentも参照してください

メンバ関数のドキュメント

[explicit protected] QTextObject::QTextObject(QTextDocument *document)

与えられたdocument に対して新しい QTextObject を作成します。

警告: この関数は決して直接呼んではいけません。QTextDocument::createObject() からしか呼んではいけません。

[virtual noexcept protected] QTextObject::~QTextObject()

テキストオブジェクトを破棄します。

警告 テキスト・オブジェクトはドキュメントが所有するものなので、決して自分で破棄してはいけません。

QTextDocument *QTextObject::document() const

このオブジェクトが属するドキュメントを返します。

format()も参照ください

QTextFormat QTextObject::format() const

テキスト・オブジェクトの書式を返します。

setFormat() およびdocument()も参照 ください。

int QTextObject::formatIndex() const

ドキュメント内部の書式リストにおける、オブジェクトの書式のインデックスを返します。

QTextDocument::allFormats()も参照ください

int QTextObject::objectIndex() const

このオブジェクトのインデックスを返します。これはQTextFormat::setObjectIndex() とともに使用できます。

[protected] void QTextObject::setFormat(const QTextFormat &format)

テキスト・オブジェクトのformat を設定する。

format()も参照

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