QTextFormat Class

QTextFormat クラスは、QTextDocument のフォーマット情報を提供します

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

QTextBlockFormat,QTextCharFormat,QTextFrameFormat, およびQTextListFormat

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

パブリック型

enum FormatType { InvalidFormat, BlockFormat, CharFormat, ListFormat, FrameFormat, UserFormat }
enum ObjectTypes { NoObject, ImageObject, TableObject, TableCellObject, UserObject }
enum PageBreakFlag { PageBreak_Auto, PageBreak_AlwaysBefore, PageBreak_AlwaysAfter }
flags PageBreakFlags
enum Property { ObjectIndex, CssFloat, LayoutDirection, OutlinePen, ForegroundBrush, …, UserProperty }

パブリック関数

QTextFormat()
QTextFormat(int type)
QTextFormat(const QTextFormat &other)
~QTextFormat()
QBrush background() const
bool boolProperty(int propertyId) const
QBrush brushProperty(int propertyId) const
void clearBackground()
void clearForeground()
void clearProperty(int propertyId)
QColor colorProperty(int propertyId) const
qreal doubleProperty(int propertyId) const
QBrush foreground() const
bool hasProperty(int propertyId) const
int intProperty(int propertyId) const
bool isBlockFormat() const
bool isCharFormat() const
bool isEmpty() const
bool isFrameFormat() const
bool isImageFormat() const
bool isListFormat() const
bool isTableCellFormat() const
bool isTableFormat() const
bool isValid() const
Qt::LayoutDirection layoutDirection() const
QTextLength lengthProperty(int propertyId) const
QList<QTextLength> lengthVectorProperty(int propertyId) const
void merge(const QTextFormat &other)
int objectIndex() const
int objectType() const
QPen penProperty(int propertyId) const
QMap<int, QVariant> properties() const
QVariant property(int propertyId) const
int propertyCount() const
void setBackground(const QBrush &brush)
void setForeground(const QBrush &brush)
void setLayoutDirection(Qt::LayoutDirection direction)
void setObjectIndex(int index)
void setObjectType(int type)
void setProperty(int propertyId, const QList<QTextLength> &value)
void setProperty(int propertyId, const QVariant &value)
QString stringProperty(int propertyId) const
void swap(QTextFormat &other)
QTextBlockFormat toBlockFormat() const
QTextCharFormat toCharFormat() const
QTextFrameFormat toFrameFormat() const
QTextImageFormat toImageFormat() const
QTextListFormat toListFormat() const
QTextTableCellFormat toTableCellFormat() const
QTextTableFormat toTableFormat() const
int type() const
QVariant operator QVariant() const
bool operator!=(const QTextFormat &other) const
QTextFormat &operator=(const QTextFormat &other)
bool operator==(const QTextFormat &other) const

詳細説明

QTextFormat は、QTextDocument の部分の書式を記述するために使用される汎用クラスです。派生クラスであるQTextCharFormat,QTextBlockFormat,QTextListFormat,QTextTableFormat は通常より有用で、ドキュメントの特定の部分に適用される書式を記述します。

書式はFormatType を持ち、書式を設定できるテキストアイテムの種類を指定します。書式はまた、Property enumで記述されているように、さまざまなプロパティ(いくつかは特定の書式タイプに固有)を持っています。すべてのプロパティは、対応するプロパティを持ちます。

フォーマット・タイプはtype() で与えられ、フォーマットはisCharFormat(),isBlockFormat(),isListFormat(),isTableFormat(),isFrameFormat(),isImageFormat() でテストできる。型が決まれば、toCharFormat ()、toBlockFormat ()、toListFormat ()、toTableFormat ()、toFrameFormat ()、toImageFormat ()で取得できる。

書式のプロパティは、setProperty ()関数で設定でき、boolProperty ()、intProperty ()、doubleProperty ()、stringProperty ()で適宜取得できる。フォーマットで使用されているすべてのプロパティIDは、allPropertyIds()で取得できます。ある書式を別の書式にマージするにはmerge() を使用します。

フォーマットのオブジェクトインデックスはsetObjectIndex() で設定でき、objectIndex() で取得できます。これらのメソッドを使用すると、書式をQTextObject に関連付けることができます。 これは、ドキュメント内でリストやフレーム、テーブルを表現するために使用されます。

リッチテキスト処理も参照してください

メンバ型ドキュメント

enum QTextFormat::FormatType

この列挙型は、QTextFormat オブジェクトがフォーマットしているテキスト項目を記述します。

定数説明
QTextFormat::InvalidFormat-1デフォルトコンストラクタによって作成された無効なフォーマット
QTextFormat::BlockFormat1オブジェクトはテキストブロックをフォーマットします。
QTextFormat::CharFormat2オブジェクトが単一の文字をフォーマットしている
QTextFormat::ListFormat3オブジェクトがリストをフォーマットしている
QTextFormat::FrameFormat5オブジェクトがフレームをフォーマットしている
QTextFormat::UserFormat100

QTextCharFormat,QTextBlockFormat,QTextListFormat,QTextTableFormat,type()も参照

enum QTextFormat::ObjectTypes

この列挙型は、この書式がどのようなQTextObject に関連付けられているかを記述する。

定数説明
QTextFormat::NoObject0
QTextFormat::ImageObject1
QTextFormat::TableObject2
QTextFormat::TableCellObject3
QTextFormat::UserObject0x1000アプリケーション固有の目的で使用できる最初のオブジェクト。

QTextObject,QTextTable,QTextObject::format()も参照してください

enum QTextFormat::PageBreakFlag
flags QTextFormat::PageBreakFlags

この列挙型は、印刷時にどのように改ページを行うかを記述します。対応する css プロパティにマッピングされます。

定数説明
QTextFormat::PageBreak_Auto0改ページは、現在のページで利用可能なスペースに応じて自動的に決定される。
QTextFormat::PageBreak_AlwaysBefore0x001ページは常に段落/テーブルの前で分割されます。
QTextFormat::PageBreak_AlwaysAfter0x010新しいページは、常に段落/テーブルの後に開始されます。

PageBreakFlags型はQFlags<PageBreakFlag>のtypedefである。PageBreakFlagの値のORの組み合わせを格納します。

QTextBlockFormat::pageBreakPolicy(),QTextFrameFormat::pageBreakPolicy(),PageBreakPolicyも参照

enum QTextFormat::Property

この列挙型は、フォーマットが持ち得るさまざまなプロパティを記述します。

定数説明
QTextFormat::ObjectIndex0x0フォーマットされたオブジェクトのインデックス。objectIndex() を参照。

段落および文字のプロパティ

定数説明
QTextFormat::CssFloat0x0800枠の、 周囲のテキス ト に対す る相対的な位置。
QTextFormat::LayoutDirection0x0801文書内のテキストのレイアウト方向(Qt::LayoutDirection )。
QTextFormat::OutlinePen0x810
QTextFormat::ForegroundBrush0x821
QTextFormat::BackgroundBrush0x820
QTextFormat::BackgroundImageUrl0x823

段落プロパティ

定数説明
QTextFormat::BlockAlignment0x1010
QTextFormat::BlockTopMargin0x1030
QTextFormat::BlockBottomMargin0x1031
QTextFormat::BlockLeftMargin0x1032
QTextFormat::BlockRightMargin0x1033
QTextFormat::TextIndent0x1034
QTextFormat::TabPositions0x1035タブ位置を指定します。タブ位置は、QList (内部的には、QList<QVariant>)に格納されるQTextOption::Tab の構造体です。
QTextFormat::BlockIndent0x1040
QTextFormat::LineHeight0x1048
QTextFormat::LineHeightType0x1049
QTextFormat::BlockNonBreakableLines0x1050
QTextFormat::BlockTrailingHorizontalRulerWidth0x1060水平ルーラー要素の幅。
QTextFormat::HeadingLevel0x1070この列挙値はQt 5.12で追加されました。
QTextFormat::BlockCodeFence0x1091Markdownのコードブロックを囲む "フェンス "で使用された文字。コードブロックがフェンスではなくインデントされていた場合、ブロックはこのプロパティを持つべきではありません。この列挙値は Qt 5.14 で追加されました。
QTextFormat::BlockQuoteLevel0x1080このブロックのネストされた引用の深さ: 1は、ブロックがトップレベルのブロック引用であることを意味します。ブロック引用符でないブロックは、このプロパティを持つべきではありません。この列挙値は Qt 5.14 で追加されました。
QTextFormat::BlockCodeLanguage0x1090プリフォーマットまたはコードブロック内のプログラミング言語。コードを含まないブロックは、このプロパティを持つべきではありません。この enum 値は Qt 5.14 で追加されました。
QTextFormat::BlockMarker0x10A0ブロックの横に表示されるtype of adornment.この enum 値は Qt 5.14 で追加されました。

文字のプロパティ

定数説明
QTextFormat::FontFamily0x2000e{このプロパティは非推奨です。}代わりに QTextFormat::FontFamilies を使用してください。
QTextFormat::FontFamilies0x1FE7
QTextFormat::FontStyleName0x1FE8
QTextFormat::FontPointSize0x2001
QTextFormat::FontPixelSize0x2009
QTextFormat::FontSizeAdjustment0x2002FontPointSize または FontPixelSize を使用して既に設定されている fontsize に与えられるサイズの変更を指定します。
QTextFormat::FontFixedPitch0x2008
QTextFormat::FontWeight0x2003
QTextFormat::FontItalic0x2004
QTextFormat::FontUnderline0x2005このプロパティは非推奨となりました。代わりに QTextFormat::TextUnderlineStyle を使用してください。
QTextFormat::FontOverline0x2006
QTextFormat::FontStrikeOut0x2007
QTextFormat::FontCapitalizationFirstFontPropertyテキストに適用する大文字/小文字の種類を指定します。
QTextFormat::FontLetterSpacingType0x1FE9FontLetterSpacing プロパティの意味を指定します。デフォルトはQFont::PercentageSpacing です。
QTextFormat::FontLetterSpacing0x1FE1フォント内の個々の文字の間のデフォルトの間隔を変更します。値は FontLetterSpacingType に従っ てパーセ ン ト 値か絶対値で指定 さ れます。デ フ ォ ル ト 値は 100% です。
QTextFormat::FontWordSpacing0x1FE2個々の単語の間のデフォルトの間隔を変更します。正の値を指定する と 、 単語の間隔が対応す る ピ ク セル分拡が り 、 負の値を指定する と 間隔が狭 く な り ます。
QTextFormat::FontStretch0x1FEAQFont::Stretch プロパティに対応
QTextFormat::FontStyleHint0x1FE3QFont::StyleHint プロパティに対応
QTextFormat::FontStyleStrategy0x1FE4QFont::StyleStrategy プロパティに対応
QTextFormat::FontKerning0x1FE5フォントがカーニングをオンにしているかどうかを指定します。
QTextFormat::FontHintingPreference0x1FE6QFont::HintingPreference enum の値に従ってヒンティングの使用を制御します。
QTextFormat::TextUnderlineColor0x2020下線 ・ 上線 ・ 取 り 消 し 線を描 く 色を指定 し ます。
QTextFormat::TextVerticalAlignment0x2021テキス ト縦組みの種類をQTextCharFormat::VerticalAlignment enum の値に従っ て指定 し ます。
QTextFormat::TextOutline0x2022テ キ ス ト の輪郭を描 く ために用い ら れ るQPen を指定 し ます。
QTextFormat::TextUnderlineStyle0x2023テキス ト の下線のス タ イルをQTextCharFormat::UnderlineStyle enum の値に従っ て指定 し ます。
QTextFormat::TextToolTip0x2024テ キ ス ト の断片に対 し て表示 さ せたい (オプシ ョ ンの) ツールチ ッ プを指定 し ます。
QTextFormat::TextSuperScriptBaseline0x2025上付きテキストのベースラインを(高さの%で)指定します。
QTextFormat::TextSubScriptBaseline0x2026下付きテキストのベースラインを(高さの % で)指定します。
QTextFormat::TextBaselineOffset0x2027テキストのベースライン (高さの %) を指定します。正の値を指定すると、テキストは対応する%だけ上に移動し、負の値を指定すると下に移動する。
QTextFormat::IsAnchor0x2030
QTextFormat::AnchorHref0x2031
QTextFormat::AnchorName0x2032
QTextFormat::ObjectType0x2f00

リストプロパティ

定数説明
QTextFormat::ListStyle0x3000リストの項目に使用されるスタイルを指定します。QTextListFormat::Style enum の値で記述します。
QTextFormat::ListIndent0x3001リストで使用されるインデントの量を指定します。
QTextFormat::ListNumberPrefix0x3002数値リストの項目番号の前に付加されるテキストを定義します。
QTextFormat::ListNumberSuffix0x3003数値リストの項目番号に付加するテキストを定義します。
QTextFormat::ListStart (since Qt 6.6)0x3004リストの最初の値を定義します。

テーブルとフレームのプロパティ

定数説明
QTextFormat::FrameBorder0x4000
QTextFormat::FrameBorderBrush0x4009
QTextFormat::FrameBorderStyle0x4010BorderStyle enum を参照。
QTextFormat::FrameBottomMargin0x4006
QTextFormat::FrameHeight0x4004
QTextFormat::FrameLeftMargin0x4007
QTextFormat::FrameMargin0x4001
QTextFormat::FramePadding0x4002
QTextFormat::FrameRightMargin0x4008
QTextFormat::FrameTopMargin0x4005
QTextFormat::FrameWidth0x4003
QTextFormat::TableCellSpacing0x4102
QTextFormat::TableCellPadding0x4103
QTextFormat::TableColumns0x4100
QTextFormat::TableColumnWidthConstraints0x4101
QTextFormat::TableHeaderRowCount0x4104
QTextFormat::TableBorderCollapse0x4105QTextTableFormat::borderCollapse プロパティを指定します。

表セルのプロパティ

定数
QTextFormat::TableCellRowSpan0x4810
QTextFormat::TableCellColumnSpan0x4811
QTextFormat::TableCellLeftPadding0x4814
QTextFormat::TableCellRightPadding0x4815
QTextFormat::TableCellTopPadding0x4812
QTextFormat::TableCellBottomPadding0x4813

QTextTableFormat::borderCollapse を有効にして使用するための表セルのプロパティ。

定数
QTextFormat::TableCellTopBorder0x4816
QTextFormat::TableCellBottomBorder0x4817
QTextFormat::TableCellLeftBorder0x4818
QTextFormat::TableCellRightBorder0x4819
QTextFormat::TableCellTopBorderStyle0x481a
QTextFormat::TableCellBottomBorderStyle0x481b
QTextFormat::TableCellLeftBorderStyle0x481c
QTextFormat::TableCellRightBorderStyle0x481d
QTextFormat::TableCellTopBorderBrush0x481e
QTextFormat::TableCellBottomBorderBrush0x481f
QTextFormat::TableCellLeftBorderBrush0x4820
QTextFormat::TableCellRightBorderBrush0x4821

画像プロパティ

一定説明
QTextFormat::ImageName0x5000画像のファイル名またはソース。
QTextFormat::ImageTitle0x5001HTML画像タグのtitle属性、またはMarkdown画像リンクのURLの後に来る引用符で囲まれた文字列。この列挙値は Qt 5.14 で追加されました。
QTextFormat::ImageAltText0x5002HTML画像タグのalt属性、またはMarkdown画像リンクの画像の説明。この列挙値は Qt 5.14 で追加されました。
QTextFormat::ImageWidth0x5010
QTextFormat::ImageHeight0x5011
QTextFormat::ImageQuality0x5014
QTextFormat::ImageMaxWidth0x5015この enum 値は Qt 6.8 で追加されました。

選択プロパティ

定数説明
QTextFormat::FullWidthSelection0x06000選択範囲の characterFormat に設定すると、テキストの幅全体が選択された状態で表示されます。

改ページプロパティ

定数説明
QTextFormat::PageBreakPolicy0x7000ページの区切り方を指定します。PageBreakFlag enumを参照。
QTextFormat::UserProperty0x100000

property() およびsetProperty()も参照

メンバ関数ドキュメント

QTextFormat::QTextFormat()

新しいテキスト書式をInvalidFormat で作成します。

FormatTypeも参照してください

[explicit] QTextFormat::QTextFormat(int type)

与えられたtype の新しいテキスト書式を作成します。

FormatTypeも参照してください

QTextFormat::QTextFormat(const QTextFormat &other)

other テキスト書式と同じ属性を持つ新しいテキスト書式を作成します。

[noexcept] QTextFormat::~QTextFormat()

このテキスト形式を破棄する。

QBrush QTextFormat::background() const

ドキュメントの背景の描画に使用したブラシを返します。

setBackground()、clearBackground() およびforeground()も参照 ください。

bool QTextFormat::boolProperty(int propertyId) const

propertyId で指定されたプロパティの値を返します。プロパティが QTextFormat::Bool 型でない場合は、代わりに false が返されます。

setProperty(),intProperty(),doubleProperty(),stringProperty(),colorProperty(),lengthProperty(),lengthVectorProperty(),Propertyも参照してください

QBrush QTextFormat::brushProperty(int propertyId) const

propertyId で指定されたプロパティの値を返します。そのプロパティがQMetaType::QBrush 型でない場合は、代わりにQt::NoBrush が返されます。

setProperty()、boolProperty()、intProperty()、doubleProperty()、stringProperty()、lengthProperty()、lengthVectorProperty()、Propertyも参照のこと

void QTextFormat::clearBackground()

ドキュメントの背景を塗るのに使われているブラシを消去します。デフォルトのブラシが使用されます。

background(),setBackground(),clearForeground()も参照

void QTextFormat::clearForeground()

ドキュメントの前景を描画するために使用されるブラシをクリアします。デフォルトのブラシが使用されます。

foreground(),setForeground(),clearBackground()も参照

void QTextFormat::clearProperty(int propertyId)

で与えられたプロパティの値をクリアします。propertyId

Propertyも参照

QColor QTextFormat::colorProperty(int propertyId) const

propertyId で与えられたプロパティの値を返す。プロパティがQMetaType::QColor 型でない場合、代わりに無効な色が返される。

setProperty()、boolProperty()、intProperty()、doubleProperty()、stringProperty()、lengthProperty()、lengthVectorProperty()、Propertyも参照の こと。

qreal QTextFormat::doubleProperty(int propertyId) const

propertyId で指定されたプロパティの値を返す。プロパティがQMetaType::Double またはQMetaType::Float 型でない場合は、代わりに 0 が返される。

setProperty()、boolProperty()、intProperty()、stringProperty()、colorProperty()、lengthProperty()、lengthVectorProperty()、Propertyも参照

QBrush QTextFormat::foreground() const

テキストやフレームのアウトライン、テーブルの枠線など、前景の詳細の描画に使用するブラシを返します。

setForeground()、clearForeground() およびbackground()も参照 ください。

bool QTextFormat::hasProperty(int propertyId) const

テ キ ス ト 形式が、 与えられたpropertyId を持つプ ロパテ ィ を持っ ていればtrue を返し、 そ う でなければfalse を返す。

properties() およびPropertyも参照してください

int QTextFormat::intProperty(int propertyId) const

propertyId で指定されたプロパティの値を返します。プロパティが QTextFormat::Integer 型でない場合は、代わりに 0 が返されます。

setProperty(),boolProperty(),doubleProperty(),stringProperty(),colorProperty(),lengthProperty(),lengthVectorProperty(),Propertyも参照

bool QTextFormat::isBlockFormat() const

このテキストフォーマットがBlockFormat であればtrue を返し、そうでなければfalse を返す。

bool QTextFormat::isCharFormat() const

このテキストフォーマットがCharFormat であればtrue を返し、そうでなければfalse を返す。

bool QTextFormat::isEmpty() const

フォーマットがプロパティを保存していない場合は true、そうでない場合は false を返します。

propertyCount() およびproperties()も参照してください

bool QTextFormat::isFrameFormat() const

このテキストフォーマットがFrameFormat であればtrue を返し、そうでなければfalse を返す。

bool QTextFormat::isImageFormat() const

このテキスト形式が画像形式の場合はtrue を返し、そうでない場合はfalse を返す。

bool QTextFormat::isListFormat() const

このテキストフォーマットがListFormat であればtrue を返し、そうでなければfalse を返す。

bool QTextFormat::isTableCellFormat() const

このテキストフォーマットがTableCellFormat であればtrue を返し、そうでなければfalse を返す。

bool QTextFormat::isTableFormat() const

このテキストフォーマットがTableFormat であればtrue を返し、そうでなければfalse を返す。

bool QTextFormat::isValid() const

フォーマットが有効な場合(すなわちInvalidFormat でない場合)はtrue を返し、そうでない場合はfalse を返す。

Qt::LayoutDirection QTextFormat::layoutDirection() const

ドキュメントのレイアウト方向を返します。

setLayoutDirection()も参照 ください。

QTextLength QTextFormat::lengthProperty(int propertyId) const

propertyId で指定されたプロパティの値を返します。

setProperty()、boolProperty()、intProperty()、doubleProperty()、stringProperty()、colorProperty()、lengthVectorProperty()、Propertyも参照

QList<QTextLength> QTextFormat::lengthVectorProperty(int propertyId) const

propertyId で与えられたプロパティの値を返します。プロパティが QTextFormat::LengthVector 型でない場合は、代わりに空のリストが返されます。

setProperty(),boolProperty(),intProperty(),doubleProperty(),stringProperty(),colorProperty(),lengthProperty(),Propertyも参照してください

void QTextFormat::merge(const QTextFormat &other)

other フォーマットとこのフォーマットをマージする。競合する場合はother フォーマットが優先される。

int QTextFormat::objectIndex() const

フォーマット・オブジェクトのインデックスを返し、フォーマット・オブジェクトが無効な場合は -1 を返します。

setObjectIndex()も参照

int QTextFormat::objectType() const

テキストフォーマットのオブジェクトタイプを返します。

ObjectTypes およびsetObjectType()も参照して ください。

QPen QTextFormat::penProperty(int propertyId) const

propertyId で指定されたプロパティの値を返します。そのプロパティがQMetaType::QPen 型でない場合は、代わりにQt::NoPen が返されます。

setProperty()、boolProperty()、intProperty()、doubleProperty()、stringProperty()、lengthProperty()、lengthVectorProperty()、Propertyも参照のこと

QMap<int, QVariant> QTextFormat::properties() const

このテキスト・フォーマットのすべてのプロパティを含むマップを返します。

QVariant QTextFormat::property(int propertyId) const

与えられたpropertyId で指定されたプロパティを返します。

setProperty() およびPropertyも参照してください

int QTextFormat::propertyCount() const

フォーマットに格納されているプロパティの数を返します。

void QTextFormat::setBackground(const QBrush &brush)

ドキュメントの背景を塗るために使用するブラシを、指定されたbrush に設定します。

background(),clearBackground(),setForeground()も参照

void QTextFormat::setForeground(const QBrush &brush)

前景ブラシを、指定したbrush に設定します。前景ブラシは主にテキストのレンダリングに使用されます。

foreground(),clearForeground(),setBackground()も参照

void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)

文書のレ イ アウ ト方向を、 指定 し たdirection に設定 し ます。

layoutDirection()も参照

void QTextFormat::setObjectIndex(int index)

フォーマットオブジェクトのオブジェクトindex を設定する。

objectIndex()も参照

void QTextFormat::setObjectType(int type)

テキスト・フォーマットのオブジェクト・タイプをtype に設定する。

ObjectTypes およびobjectType()も参照のこと

void QTextFormat::setProperty(int propertyId, const QList<QTextLength> &value)

propertyId で与えられたプロパティの値をvalue に設定します。

property()、lengthVectorProperty()、Propertyも参照

void QTextFormat::setProperty(int propertyId, const QVariant &value)

propertyId で指定されたプロパティを、与えられたvalue に設定します。

Propertyも参照

QString QTextFormat::stringProperty(int propertyId) const

propertyId で指定されたプロパティの値を返す。プロパティがQMetaType::QString 型でない場合は、代わりに空文字列が返される。

setProperty()、boolProperty()、intProperty()、doubleProperty()、colorProperty()、lengthProperty()、lengthVectorProperty()、Propertyも参照

void QTextFormat::swap(QTextFormat &other)

このテキスト形式をother と交換する。この操作は非常に高速で、失敗することはない。

QTextBlockFormat QTextFormat::toBlockFormat() const

この書式をブロック書式として返します。

QTextCharFormat QTextFormat::toCharFormat() const

この書式を文字書式として返します。

QTextFrameFormat QTextFormat::toFrameFormat() const

このフォーマットをフレームフォーマットとして返します。

QTextImageFormat QTextFormat::toImageFormat() const

このフォーマットを画像フォーマットとして返します。

QTextListFormat QTextFormat::toListFormat() const

この書式をリスト形式で返します。

QTextTableCellFormat QTextFormat::toTableCellFormat() const

この書式を表のセル書式として返します。

QTextTableFormat QTextFormat::toTableFormat() const

この書式を表形式として返します。

int QTextFormat::type() const

このフォーマットの型を返します。

FormatTypeも参照

QVariant QTextFormat::operator QVariant() const

テキストフォーマットをQVariant

bool QTextFormat::operator!=(const QTextFormat &other) const

このテキストフォーマットがother テキストフォーマットと異なる場合はtrue を返す。

QTextFormat &QTextFormat::operator=(const QTextFormat &other)

other テキス ト 書式を こ のテ キ ス ト 書式に割 り 当て、 こ のテ キ ス ト 書式への参照を返 し ます。

bool QTextFormat::operator==(const QTextFormat &other) const

このテキスト書式がother テキスト書式と同じならtrue を返す。

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