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 |
- 継承メンバを含む全メンバ一覧
- QTextFormat はRich Text Processing APIおよびImplicitly Shared Classes に含まれます。
注意:このクラスの関数はすべてリエントラントです。
パブリック型
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::BlockFormat | 1 | オブジェクトはテキストブロックをフォーマットします。 |
QTextFormat::CharFormat | 2 | オブジェクトが単一の文字をフォーマットしている |
QTextFormat::ListFormat | 3 | オブジェクトがリストをフォーマットしている |
QTextFormat::FrameFormat | 5 | オブジェクトがフレームをフォーマットしている |
QTextFormat::UserFormat | 100 |
QTextCharFormat,QTextBlockFormat,QTextListFormat,QTextTableFormat,type()も参照 。
enum QTextFormat::ObjectTypes
この列挙型は、この書式がどのようなQTextObject に関連付けられているかを記述する。
定数 | 値 | 説明 |
---|---|---|
QTextFormat::NoObject | 0 | |
QTextFormat::ImageObject | 1 | |
QTextFormat::TableObject | 2 | |
QTextFormat::TableCellObject | 3 | |
QTextFormat::UserObject | 0x1000 | アプリケーション固有の目的で使用できる最初のオブジェクト。 |
QTextObject,QTextTable,QTextObject::format()も参照してください 。
enum QTextFormat::PageBreakFlag
flags QTextFormat::PageBreakFlags
この列挙型は、印刷時にどのように改ページを行うかを記述します。対応する css プロパティにマッピングされます。
定数 | 値 | 説明 |
---|---|---|
QTextFormat::PageBreak_Auto | 0 | 改ページは、現在のページで利用可能なスペースに応じて自動的に決定される。 |
QTextFormat::PageBreak_AlwaysBefore | 0x001 | ページは常に段落/テーブルの前で分割されます。 |
QTextFormat::PageBreak_AlwaysAfter | 0x010 | 新しいページは、常に段落/テーブルの後に開始されます。 |
PageBreakFlags型はQFlags<PageBreakFlag>のtypedefである。PageBreakFlagの値のORの組み合わせを格納します。
QTextBlockFormat::pageBreakPolicy(),QTextFrameFormat::pageBreakPolicy(),PageBreakPolicyも参照 。
enum QTextFormat::Property
この列挙型は、フォーマットが持ち得るさまざまなプロパティを記述します。
定数 | 値 | 説明 |
---|---|---|
QTextFormat::ObjectIndex | 0x0 | フォーマットされたオブジェクトのインデックス。objectIndex() を参照。 |
段落および文字のプロパティ
定数 | 値 | 説明 |
---|---|---|
QTextFormat::CssFloat | 0x0800 | 枠の、 周囲のテキス ト に対す る相対的な位置。 |
QTextFormat::LayoutDirection | 0x0801 | 文書内のテキストのレイアウト方向(Qt::LayoutDirection )。 |
QTextFormat::OutlinePen | 0x810 | |
QTextFormat::ForegroundBrush | 0x821 | |
QTextFormat::BackgroundBrush | 0x820 | |
QTextFormat::BackgroundImageUrl | 0x823 |
段落プロパティ
定数 | 値 | 説明 |
---|---|---|
QTextFormat::BlockAlignment | 0x1010 | |
QTextFormat::BlockTopMargin | 0x1030 | |
QTextFormat::BlockBottomMargin | 0x1031 | |
QTextFormat::BlockLeftMargin | 0x1032 | |
QTextFormat::BlockRightMargin | 0x1033 | |
QTextFormat::TextIndent | 0x1034 | |
QTextFormat::TabPositions | 0x1035 | タブ位置を指定します。タブ位置は、QList (内部的には、QList<QVariant>)に格納されるQTextOption::Tab の構造体です。 |
QTextFormat::BlockIndent | 0x1040 | |
QTextFormat::LineHeight | 0x1048 | |
QTextFormat::LineHeightType | 0x1049 | |
QTextFormat::BlockNonBreakableLines | 0x1050 | |
QTextFormat::BlockTrailingHorizontalRulerWidth | 0x1060 | 水平ルーラー要素の幅。 |
QTextFormat::HeadingLevel | 0x1070 | この列挙値はQt 5.12で追加されました。 |
QTextFormat::BlockCodeFence | 0x1091 | Markdownのコードブロックを囲む "フェンス "で使用された文字。コードブロックがフェンスではなくインデントされていた場合、ブロックはこのプロパティを持つべきではありません。この列挙値は Qt 5.14 で追加されました。 |
QTextFormat::BlockQuoteLevel | 0x1080 | このブロックのネストされた引用の深さ: 1は、ブロックがトップレベルのブロック引用であることを意味します。ブロック引用符でないブロックは、このプロパティを持つべきではありません。この列挙値は Qt 5.14 で追加されました。 |
QTextFormat::BlockCodeLanguage | 0x1090 | プリフォーマットまたはコードブロック内のプログラミング言語。コードを含まないブロックは、このプロパティを持つべきではありません。この enum 値は Qt 5.14 で追加されました。 |
QTextFormat::BlockMarker | 0x10A0 | ブロックの横に表示されるtype of adornment.この enum 値は Qt 5.14 で追加されました。 |
文字のプロパティ
定数 | 値 | 説明 |
---|---|---|
QTextFormat::FontFamily | 0x2000 | e{このプロパティは非推奨です。}代わりに QTextFormat::FontFamilies を使用してください。 |
QTextFormat::FontFamilies | 0x1FE7 | |
QTextFormat::FontStyleName | 0x1FE8 | |
QTextFormat::FontPointSize | 0x2001 | |
QTextFormat::FontPixelSize | 0x2009 | |
QTextFormat::FontSizeAdjustment | 0x2002 | FontPointSize または FontPixelSize を使用して既に設定されている fontsize に与えられるサイズの変更を指定します。 |
QTextFormat::FontFixedPitch | 0x2008 | |
QTextFormat::FontWeight | 0x2003 | |
QTextFormat::FontItalic | 0x2004 | |
QTextFormat::FontUnderline | 0x2005 | このプロパティは非推奨となりました。代わりに QTextFormat::TextUnderlineStyle を使用してください。 |
QTextFormat::FontOverline | 0x2006 | |
QTextFormat::FontStrikeOut | 0x2007 | |
QTextFormat::FontCapitalization | FirstFontProperty | テキストに適用する大文字/小文字の種類を指定します。 |
QTextFormat::FontLetterSpacingType | 0x1FE9 | FontLetterSpacing プロパティの意味を指定します。デフォルトはQFont::PercentageSpacing です。 |
QTextFormat::FontLetterSpacing | 0x1FE1 | フォント内の個々の文字の間のデフォルトの間隔を変更します。値は FontLetterSpacingType に従っ てパーセ ン ト 値か絶対値で指定 さ れます。デ フ ォ ル ト 値は 100% です。 |
QTextFormat::FontWordSpacing | 0x1FE2 | 個々の単語の間のデフォルトの間隔を変更します。正の値を指定する と 、 単語の間隔が対応す る ピ ク セル分拡が り 、 負の値を指定する と 間隔が狭 く な り ます。 |
QTextFormat::FontStretch | 0x1FEA | QFont::Stretch プロパティに対応 |
QTextFormat::FontStyleHint | 0x1FE3 | QFont::StyleHint プロパティに対応 |
QTextFormat::FontStyleStrategy | 0x1FE4 | QFont::StyleStrategy プロパティに対応 |
QTextFormat::FontKerning | 0x1FE5 | フォントがカーニングをオンにしているかどうかを指定します。 |
QTextFormat::FontHintingPreference | 0x1FE6 | QFont::HintingPreference enum の値に従ってヒンティングの使用を制御します。 |
QTextFormat::TextUnderlineColor | 0x2020 | 下線 ・ 上線 ・ 取 り 消 し 線を描 く 色を指定 し ます。 |
QTextFormat::TextVerticalAlignment | 0x2021 | テキス ト縦組みの種類をQTextCharFormat::VerticalAlignment enum の値に従っ て指定 し ます。 |
QTextFormat::TextOutline | 0x2022 | テ キ ス ト の輪郭を描 く ために用い ら れ るQPen を指定 し ます。 |
QTextFormat::TextUnderlineStyle | 0x2023 | テキス ト の下線のス タ イルをQTextCharFormat::UnderlineStyle enum の値に従っ て指定 し ます。 |
QTextFormat::TextToolTip | 0x2024 | テ キ ス ト の断片に対 し て表示 さ せたい (オプシ ョ ンの) ツールチ ッ プを指定 し ます。 |
QTextFormat::TextSuperScriptBaseline | 0x2025 | 上付きテキストのベースラインを(高さの%で)指定します。 |
QTextFormat::TextSubScriptBaseline | 0x2026 | 下付きテキストのベースラインを(高さの % で)指定します。 |
QTextFormat::TextBaselineOffset | 0x2027 | テキストのベースライン (高さの %) を指定します。正の値を指定すると、テキストは対応する%だけ上に移動し、負の値を指定すると下に移動する。 |
QTextFormat::IsAnchor | 0x2030 | |
QTextFormat::AnchorHref | 0x2031 | |
QTextFormat::AnchorName | 0x2032 | |
QTextFormat::ObjectType | 0x2f00 |
リストプロパティ
定数 | 値 | 説明 |
---|---|---|
QTextFormat::ListStyle | 0x3000 | リストの項目に使用されるスタイルを指定します。QTextListFormat::Style enum の値で記述します。 |
QTextFormat::ListIndent | 0x3001 | リストで使用されるインデントの量を指定します。 |
QTextFormat::ListNumberPrefix | 0x3002 | 数値リストの項目番号の前に付加されるテキストを定義します。 |
QTextFormat::ListNumberSuffix | 0x3003 | 数値リストの項目番号に付加するテキストを定義します。 |
QTextFormat::ListStart (since Qt 6.6) | 0x3004 | リストの最初の値を定義します。 |
テーブルとフレームのプロパティ
定数 | 値 | 説明 |
---|---|---|
QTextFormat::FrameBorder | 0x4000 | |
QTextFormat::FrameBorderBrush | 0x4009 | |
QTextFormat::FrameBorderStyle | 0x4010 | BorderStyle enum を参照。 |
QTextFormat::FrameBottomMargin | 0x4006 | |
QTextFormat::FrameHeight | 0x4004 | |
QTextFormat::FrameLeftMargin | 0x4007 | |
QTextFormat::FrameMargin | 0x4001 | |
QTextFormat::FramePadding | 0x4002 | |
QTextFormat::FrameRightMargin | 0x4008 | |
QTextFormat::FrameTopMargin | 0x4005 | |
QTextFormat::FrameWidth | 0x4003 | |
QTextFormat::TableCellSpacing | 0x4102 | |
QTextFormat::TableCellPadding | 0x4103 | |
QTextFormat::TableColumns | 0x4100 | |
QTextFormat::TableColumnWidthConstraints | 0x4101 | |
QTextFormat::TableHeaderRowCount | 0x4104 | |
QTextFormat::TableBorderCollapse | 0x4105 | QTextTableFormat::borderCollapse プロパティを指定します。 |
表セルのプロパティ
定数 | 値 |
---|---|
QTextFormat::TableCellRowSpan | 0x4810 |
QTextFormat::TableCellColumnSpan | 0x4811 |
QTextFormat::TableCellLeftPadding | 0x4814 |
QTextFormat::TableCellRightPadding | 0x4815 |
QTextFormat::TableCellTopPadding | 0x4812 |
QTextFormat::TableCellBottomPadding | 0x4813 |
QTextTableFormat::borderCollapse を有効にして使用するための表セルのプロパティ。
定数 | 値 |
---|---|
QTextFormat::TableCellTopBorder | 0x4816 |
QTextFormat::TableCellBottomBorder | 0x4817 |
QTextFormat::TableCellLeftBorder | 0x4818 |
QTextFormat::TableCellRightBorder | 0x4819 |
QTextFormat::TableCellTopBorderStyle | 0x481a |
QTextFormat::TableCellBottomBorderStyle | 0x481b |
QTextFormat::TableCellLeftBorderStyle | 0x481c |
QTextFormat::TableCellRightBorderStyle | 0x481d |
QTextFormat::TableCellTopBorderBrush | 0x481e |
QTextFormat::TableCellBottomBorderBrush | 0x481f |
QTextFormat::TableCellLeftBorderBrush | 0x4820 |
QTextFormat::TableCellRightBorderBrush | 0x4821 |
画像プロパティ
一定 | 値 | 説明 |
---|---|---|
QTextFormat::ImageName | 0x5000 | 画像のファイル名またはソース。 |
QTextFormat::ImageTitle | 0x5001 | HTML画像タグのtitle属性、またはMarkdown画像リンクのURLの後に来る引用符で囲まれた文字列。この列挙値は Qt 5.14 で追加されました。 |
QTextFormat::ImageAltText | 0x5002 | HTML画像タグのalt属性、またはMarkdown画像リンクの画像の説明。この列挙値は Qt 5.14 で追加されました。 |
QTextFormat::ImageWidth | 0x5010 | |
QTextFormat::ImageHeight | 0x5011 | |
QTextFormat::ImageQuality | 0x5014 | |
QTextFormat::ImageMaxWidth | 0x5015 | この enum 値は Qt 6.8 で追加されました。 |
選択プロパティ
定数 | 値 | 説明 |
---|---|---|
QTextFormat::FullWidthSelection | 0x06000 | 選択範囲の characterFormat に設定すると、テキストの幅全体が選択された状態で表示されます。 |
改ページプロパティ
定数 | 値 | 説明 |
---|---|---|
QTextFormat::PageBreakPolicy | 0x7000 | ページの区切り方を指定します。PageBreakFlag enumを参照。 |
QTextFormat::UserProperty | 0x100000 |
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.