QTextFormat Class
Die Klasse QTextFormat liefert Formatierungsinformationen für eine QTextDocument. Mehr...
Kopfzeile: | #include <QTextFormat> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
Vererbt von: | QTextBlockFormat, QTextCharFormat, QTextFrameFormat, und QTextListFormat |
- Liste aller Mitglieder, einschließlich geerbter Mitglieder
- QTextFormat ist Teil von Rich Text Processing APIs und Implicitly Shared Classes.
Hinweis: Alle Funktionen in dieser Klasse sind reentrant.
Öffentliche Typen
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 } |
Öffentliche Funktionen
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 |
Detaillierte Beschreibung
Ein QTextFormat ist eine generische Klasse zur Beschreibung des Formats von Teilen eines QTextDocument. Die abgeleiteten Klassen QTextCharFormat, QTextBlockFormat, QTextListFormat und QTextTableFormat sind in der Regel nützlicher und beschreiben die Formatierung, die auf bestimmte Teile des Dokuments angewendet wird.
Ein Format hat eine FormatType
, die die Arten von Textelementen angibt, die es formatieren kann, z. B. einen Textblock, eine Liste, eine Tabelle usw. Ein Format hat auch verschiedene Eigenschaften (einige spezifisch für bestimmte Formattypen), die durch das Property-Enum beschrieben werden. Jede Eigenschaft hat eine entsprechende Property.
Der Formattyp wird durch type() angegeben, und das Format kann mit isCharFormat(), isBlockFormat(), isListFormat(), isTableFormat(), isFrameFormat() und isImageFormat() getestet werden. Wenn der Typ bestimmt ist, kann er mit toCharFormat(), toBlockFormat(), toListFormat(), toTableFormat(), toFrameFormat() und toImageFormat() abgerufen werden.
Die Eigenschaften eines Formats können mit den Funktionen setProperty() festgelegt und gegebenenfalls mit boolProperty(), intProperty(), doubleProperty() und stringProperty() abgerufen werden. Alle im Format verwendeten Eigenschafts-IDs können mit allPropertyIds() abgerufen werden. Ein Format kann mit merge() in ein anderes zusammengeführt werden.
Der Objektindex eines Formats kann mit setObjectIndex() gesetzt und mit objectIndex() abgerufen werden. Diese Methoden können verwendet werden, um das Format mit einem QTextObject zu verknüpfen. Es wird verwendet, um Listen, Rahmen und Tabellen innerhalb des Dokuments darzustellen.
Siehe auch Rich Text Processing.
Dokumentation der Mitgliedstypen
enum QTextFormat::FormatType
Diese Aufzählung beschreibt das Textelement, das ein QTextFormat Objekt formatiert.
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::InvalidFormat | -1 | Ein ungültiges Format, wie es vom Standardkonstruktor erzeugt wird |
QTextFormat::BlockFormat | 1 | Das Objekt formatiert einen Textblock |
QTextFormat::CharFormat | 2 | Das Objekt formatiert ein einzelnes Zeichen |
QTextFormat::ListFormat | 3 | Das Objekt formatiert eine Liste |
QTextFormat::FrameFormat | 5 | Das Objekt formatiert einen Rahmen |
QTextFormat::UserFormat | 100 |
Siehe auch QTextCharFormat, QTextBlockFormat, QTextListFormat, QTextTableFormat, und type().
enum QTextFormat::ObjectTypes
Diese Aufzählung beschreibt, mit welcher Art von QTextObject dieses Format verbunden ist.
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::NoObject | 0 | |
QTextFormat::ImageObject | 1 | |
QTextFormat::TableObject | 2 | |
QTextFormat::TableCellObject | 3 | |
QTextFormat::UserObject | 0x1000 | Das erste Objekt, das für anwendungsspezifische Zwecke verwendet werden kann. |
Siehe auch QTextObject, QTextTable, und QTextObject::format().
enum QTextFormat::PageBreakFlag
flags QTextFormat::PageBreakFlags
Diese Aufzählung beschreibt, wie der Seitenumbruch beim Drucken durchgeführt wird. Sie entspricht den entsprechenden css-Eigenschaften.
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::PageBreak_Auto | 0 | Der Seitenumbruch wird automatisch in Abhängigkeit vom verfügbaren Platz auf der aktuellen Seite bestimmt |
QTextFormat::PageBreak_AlwaysBefore | 0x001 | Die Seite wird immer vor dem Absatz/der Tabelle umgebrochen |
QTextFormat::PageBreak_AlwaysAfter | 0x010 | Eine neue Seite wird immer nach dem Absatz/der Tabelle begonnen |
Der Typ PageBreakFlags ist ein Typedef für QFlags<PageBreakFlag>. Er speichert eine ODER-Kombination von PageBreakFlag-Werten.
Siehe auch QTextBlockFormat::pageBreakPolicy(), QTextFrameFormat::pageBreakPolicy(), und PageBreakPolicy.
enum QTextFormat::Property
Diese Aufzählung beschreibt die verschiedenen Eigenschaften, die ein Format haben kann.
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::ObjectIndex | 0x0 | Der Index des formatierten Objekts. Siehe objectIndex(). |
Absatz- und Zeicheneigenschaften
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::CssFloat | 0x0800 | Wie ein Rahmen relativ zum umgebenden Text angeordnet ist |
QTextFormat::LayoutDirection | 0x0801 | Die Layout-Richtung des Textes im Dokument (Qt::LayoutDirection). |
QTextFormat::OutlinePen | 0x810 | |
QTextFormat::ForegroundBrush | 0x821 | |
QTextFormat::BackgroundBrush | 0x820 | |
QTextFormat::BackgroundImageUrl | 0x823 |
Absatz-Eigenschaften
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::BlockAlignment | 0x1010 | |
QTextFormat::BlockTopMargin | 0x1030 | |
QTextFormat::BlockBottomMargin | 0x1031 | |
QTextFormat::BlockLeftMargin | 0x1032 | |
QTextFormat::BlockRightMargin | 0x1033 | |
QTextFormat::TextIndent | 0x1034 | |
QTextFormat::TabPositions | 0x1035 | Gibt die Tabulatorpositionen an. Die Tabulatorpositionen sind Structs von QTextOption::Tab, die in einem QList (intern in einem QList<QVariant>) gespeichert werden. |
QTextFormat::BlockIndent | 0x1040 | |
QTextFormat::LineHeight | 0x1048 | |
QTextFormat::LineHeightType | 0x1049 | |
QTextFormat::BlockNonBreakableLines | 0x1050 | |
QTextFormat::BlockTrailingHorizontalRulerWidth | 0x1060 | Die Breite eines horizontalen Linealelements. |
QTextFormat::HeadingLevel | 0x1070 | Die Ebene einer Überschrift, z.B. 1 entspricht einem HTML H1-Tag, sonst 0. Dieser Enum-Wert wurde in Qt 5.12 hinzugefügt. |
QTextFormat::BlockCodeFence | 0x1091 | Das Zeichen, das in den "Zäunen" um einen Markdown-Codeblock verwendet wurde. Wenn der Codeblock eingerückt und nicht umrahmt wurde, sollte der Block diese Eigenschaft nicht haben. Dieser Enum-Wert wurde in Qt 5.14 hinzugefügt. |
QTextFormat::BlockQuoteLevel | 0x1080 | Die Tiefe der verschachtelten Anführungszeichen in diesem Block: 1 bedeutet, dass der Block ein Block-Zeichen der obersten Ebene ist. Blöcke, die keine Blockquotierungen sind, sollten diese Eigenschaft nicht haben. Dieser Enum-Wert wurde in Qt 5.14 hinzugefügt. |
QTextFormat::BlockCodeLanguage | 0x1090 | Die Programmiersprache in einem vorformatierten oder Code-Block. Blöcke, die keinen Code enthalten, sollten diese Eigenschaft nicht haben. Dieser Enum-Wert wurde in Qt 5.14 hinzugefügt. |
QTextFormat::BlockMarker | 0x10A0 | Die type of adornment, die neben dem Block angezeigt wird. Dieser Enum-Wert wurde in Qt 5.14 hinzugefügt. |
Zeichen-Eigenschaften
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::FontFamily | 0x2000 | e{Diese Eigenschaft ist veraltet.} Verwenden Sie stattdessen QTextFormat::FontFamilies. |
QTextFormat::FontFamilies | 0x1FE7 | |
QTextFormat::FontStyleName | 0x1FE8 | |
QTextFormat::FontPointSize | 0x2001 | |
QTextFormat::FontPixelSize | 0x2009 | |
QTextFormat::FontSizeAdjustment | 0x2002 | Gibt die Größenänderung der bereits mit FontPointSize oder FontPixelSize eingestellten Schriftgröße an. |
QTextFormat::FontFixedPitch | 0x2008 | |
QTextFormat::FontWeight | 0x2003 | |
QTextFormat::FontItalic | 0x2004 | |
QTextFormat::FontUnderline | 0x2005 | Diese Eigenschaft ist veraltet. Verwenden Sie stattdessen QTextFormat::TextUnderlineStyle. |
QTextFormat::FontOverline | 0x2006 | |
QTextFormat::FontStrikeOut | 0x2007 | |
QTextFormat::FontCapitalization | FirstFontProperty | Gibt die Art der Großschreibung an, die auf den Text angewendet werden soll. |
QTextFormat::FontLetterSpacingType | 0x1FE9 | Legt die Bedeutung der Eigenschaft FontLetterSpacing fest. Die Vorgabe ist QFont::PercentageSpacing. |
QTextFormat::FontLetterSpacing | 0x1FE1 | Ändert den Standardabstand zwischen einzelnen Buchstaben in der Schriftart. Der Wert wird je nach FontLetterSpacingType als Prozentwert oder absoluter Wert angegeben. Der Standardwert ist 100%. |
QTextFormat::FontWordSpacing | 0x1FE2 | Ändert den Standardabstand zwischen den einzelnen Wörtern. Ein positiver Wert vergrößert den Wortabstand um die entsprechenden Pixel, ein negativer Wert verkleinert den Abstand. |
QTextFormat::FontStretch | 0x1FEA | Entspricht der Eigenschaft QFont::Stretch |
QTextFormat::FontStyleHint | 0x1FE3 | Entspricht der Eigenschaft QFont::StyleHint |
QTextFormat::FontStyleStrategy | 0x1FE4 | Entspricht der Eigenschaft QFont::StyleStrategy |
QTextFormat::FontKerning | 0x1FE5 | Gibt an, ob in der Schriftart das Kerning aktiviert ist. |
QTextFormat::FontHintingPreference | 0x1FE6 | Steuert die Verwendung von Hinting entsprechend den Werten des QFont::HintingPreference enum. |
QTextFormat::TextUnderlineColor | 0x2020 | Legt die Farbe für Unterstreichungen, Überstreichungen und Durchstreichungen fest. |
QTextFormat::TextVerticalAlignment | 0x2021 | Legt die Art der vertikalen Ausrichtung des Textes entsprechend den Werten der Aufzählung QTextCharFormat::VerticalAlignment fest. |
QTextFormat::TextOutline | 0x2022 | Legt eine QPen fest, die zum Zeichnen der Textkontur verwendet wird. |
QTextFormat::TextUnderlineStyle | 0x2023 | Legt den Stil der Textunterstreichung entsprechend den Werten des QTextCharFormat::UnderlineStyle enum fest. |
QTextFormat::TextToolTip | 0x2024 | Legt den (optionalen) Tooltip fest, der für ein Textfragment angezeigt werden soll. |
QTextFormat::TextSuperScriptBaseline | 0x2025 | Legt die Grundlinie (in % der Höhe) von hochgestellten Texten fest. |
QTextFormat::TextSubScriptBaseline | 0x2026 | Legt die Grundlinie (in % der Höhe) von tiefgestellten Texten fest. |
QTextFormat::TextBaselineOffset | 0x2027 | Legt die Grundlinie (in % der Höhe) des Textes fest. Ein positiver Wert verschiebt den Text um den entsprechenden Prozentsatz nach oben; ein negativer Wert verschiebt ihn nach unten. |
QTextFormat::IsAnchor | 0x2030 | |
QTextFormat::AnchorHref | 0x2031 | |
QTextFormat::AnchorName | 0x2032 | |
QTextFormat::ObjectType | 0x2f00 |
Eigenschaften der Liste
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::ListStyle | 0x3000 | Gibt den Stil an, der für die Elemente in einer Liste verwendet wird, beschrieben durch die Werte des QTextListFormat::Style enum. |
QTextFormat::ListIndent | 0x3001 | Legt den Umfang der Einrückung einer Liste fest. |
QTextFormat::ListNumberPrefix | 0x3002 | Legt den Text fest, der den Positionsnummern in numerischen Listen vorangestellt wird. |
QTextFormat::ListNumberSuffix | 0x3003 | Legt den Text fest, der in numerischen Listen an die Positionsnummern angehängt wird. |
QTextFormat::ListStart (since Qt 6.6) | 0x3004 | Legt den ersten Wert einer Liste fest. |
Eigenschaften von Tabellen und Rahmen
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::FrameBorder | 0x4000 | |
QTextFormat::FrameBorderBrush | 0x4009 | |
QTextFormat::FrameBorderStyle | 0x4010 | Siehe die Aufzählung BorderStyle. |
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 | Gibt die Eigenschaft QTextTableFormat::borderCollapse an. |
Eigenschaften von Tabellenzellen
Konstante | Wert |
---|---|
QTextFormat::TableCellRowSpan | 0x4810 |
QTextFormat::TableCellColumnSpan | 0x4811 |
QTextFormat::TableCellLeftPadding | 0x4814 |
QTextFormat::TableCellRightPadding | 0x4815 |
QTextFormat::TableCellTopPadding | 0x4812 |
QTextFormat::TableCellBottomPadding | 0x4813 |
Eigenschaften von Tabellenzellen, die für die Verwendung bei aktiviertem QTextTableFormat::borderCollapse vorgesehen sind
Konstante | Wert |
---|---|
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 |
Bild-Eigenschaften
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::ImageName | 0x5000 | Der Dateiname oder die Quelle des Bildes. |
QTextFormat::ImageTitle | 0x5001 | Das title-Attribut eines HTML-Bild-Tags oder der String in Anführungszeichen, der nach der URL in einem Markdown-Bild-Link steht. Dieser Enum-Wert wurde in Qt 5.14 hinzugefügt. |
QTextFormat::ImageAltText | 0x5002 | Das alt-Attribut eines HTML-Image-Tags oder die Bildbeschreibung in einem Markdown-Image-Link. Dieser Enum-Wert wurde in Qt 5.14 hinzugefügt. |
QTextFormat::ImageWidth | 0x5010 | |
QTextFormat::ImageHeight | 0x5011 | |
QTextFormat::ImageQuality | 0x5014 | |
QTextFormat::ImageMaxWidth | 0x5015 | Dieser Enum-Wert wurde in Qt 6.8 hinzugefügt. |
Eigenschaften der Auswahl
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::FullWidthSelection | 0x06000 | Wenn dieser Wert auf das characterFormat einer Auswahl gesetzt ist, wird die gesamte Breite des Textes ausgewählt dargestellt. |
Seitenumbruch-Eigenschaften
Konstante | Wert | Beschreibung |
---|---|---|
QTextFormat::PageBreakPolicy | 0x7000 | Legt fest, wie die Seiten umgebrochen werden. Siehe die Aufzählung PageBreakFlag. |
QTextFormat::UserProperty | 0x100000 |
Siehe auch property() und setProperty().
Dokumentation der Mitgliedsfunktionen
QTextFormat::QTextFormat()
Erzeugt ein neues Textformat mit einem InvalidFormat
.
Siehe auch FormatType.
[explicit]
QTextFormat::QTextFormat(int type)
Erzeugt ein neues Textformat mit dem angegebenen type.
Siehe auch FormatType.
QTextFormat::QTextFormat(const QTextFormat &other)
Erzeugt ein neues Textformat mit denselben Attributen wie das Textformat other.
[noexcept]
QTextFormat::~QTextFormat()
Zerstört dieses Textformat.
QBrush QTextFormat::background() const
Gibt den Pinsel zurück, mit dem der Hintergrund des Dokuments gemalt wurde.
Siehe auch setBackground(), clearBackground(), und foreground().
bool QTextFormat::boolProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück. Wenn die Eigenschaft nicht vom Typ QTextFormat::Bool ist, wird stattdessen false zurückgegeben.
Siehe auch setProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), und Property.
QBrush QTextFormat::brushProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück; wenn die Eigenschaft nicht vom Typ QMetaType::QBrush ist, wird stattdessen Qt::NoBrush zurückgegeben.
Siehe auch setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), und Property.
void QTextFormat::clearBackground()
Löscht den Pinsel, mit dem der Hintergrund des Dokuments gemalt wurde. Es wird der Standardpinsel verwendet.
Siehe auch background(), setBackground(), und clearForeground().
void QTextFormat::clearForeground()
Löscht den Pinsel, mit dem der Vordergrund des Dokuments gemalt wird. Es wird der Standardpinsel verwendet.
Siehe auch foreground(), setForeground(), und clearBackground().
void QTextFormat::clearProperty(int propertyId)
Löscht den Wert der Eigenschaft, die durch propertyId
Siehe auch Property.
QColor QTextFormat::colorProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück; wenn die Eigenschaft nicht vom Typ QMetaType::QColor ist, wird stattdessen eine ungültige Farbe zurückgegeben.
Siehe auch setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), und Property.
qreal QTextFormat::doubleProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück. Wenn die Eigenschaft nicht vom Typ QMetaType::Double oder QMetaType::Float ist, wird stattdessen 0 zurückgegeben.
Siehe auch setProperty(), boolProperty(), intProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), und Property.
QBrush QTextFormat::foreground() const
Gibt den Pinsel zurück, der zum Rendern von Details im Vordergrund verwendet wird, wie z. B. Text, Rahmenumrisse und Tabellenränder.
Siehe auch setForeground(), clearForeground(), und background().
bool QTextFormat::hasProperty(int propertyId) const
Gibt true
zurück, wenn das Textformat eine Eigenschaft mit der angegebenen propertyId hat; andernfalls wird false
zurückgegeben.
Siehe auch properties() und Property.
int QTextFormat::intProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück. Wenn die Eigenschaft nicht vom Typ QTextFormat::Integer ist, wird stattdessen 0 zurückgegeben.
Siehe auch setProperty(), boolProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), und Property.
bool QTextFormat::isBlockFormat() const
Gibt true
zurück, wenn dieses Textformat ein BlockFormat
ist; andernfalls wird false
zurückgegeben.
bool QTextFormat::isCharFormat() const
Gibt true
zurück, wenn dieses Textformat ein CharFormat
ist; andernfalls wird false
zurückgegeben.
bool QTextFormat::isEmpty() const
Gibt true zurück, wenn das Format keine Eigenschaften speichert; andernfalls false.
Siehe auch propertyCount() und properties().
bool QTextFormat::isFrameFormat() const
Gibt true
zurück, wenn dieses Textformat ein FrameFormat
ist; andernfalls wird false
zurückgegeben.
bool QTextFormat::isImageFormat() const
Gibt true
zurück, wenn dieses Textformat ein Bildformat ist; andernfalls wird false
zurückgegeben.
bool QTextFormat::isListFormat() const
Gibt true
zurück, wenn dieses Textformat ein ListFormat
ist; andernfalls wird false
zurückgegeben.
bool QTextFormat::isTableCellFormat() const
Gibt true
zurück, wenn dieses Textformat ein TableCellFormat
ist; andernfalls wird false
zurückgegeben.
bool QTextFormat::isTableFormat() const
Gibt true
zurück, wenn dieses Textformat ein TableFormat
ist; andernfalls wird false
zurückgegeben.
bool QTextFormat::isValid() const
Gibt true
zurück, wenn das Format gültig ist (d.h. nicht InvalidFormat); andernfalls wird false
zurückgegeben.
Qt::LayoutDirection QTextFormat::layoutDirection() const
Gibt die Layout-Richtung des Dokuments zurück.
Siehe auch setLayoutDirection().
QTextLength QTextFormat::lengthProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück.
Siehe auch setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthVectorProperty(), und Property.
QList<QTextLength> QTextFormat::lengthVectorProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück. Wenn die Eigenschaft nicht vom Typ QTextFormat::LengthVector ist, wird stattdessen eine leere Liste zurückgegeben.
Siehe auch setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), und Property.
void QTextFormat::merge(const QTextFormat &other)
Mischt das Format other mit diesem Format; bei Konflikten hat das Format other Vorrang.
int QTextFormat::objectIndex() const
Gibt den Index des Format-Objekts zurück, oder -1, wenn das Format-Objekt ungültig ist.
Siehe auch setObjectIndex().
int QTextFormat::objectType() const
Gibt den Objekttyp des Textformats zurück.
Siehe auch ObjectTypes und setObjectType().
QPen QTextFormat::penProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück; wenn die Eigenschaft nicht vom Typ QMetaType::QPen ist, wird stattdessen Qt::NoPen zurückgegeben.
Siehe auch setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), und Property.
QMap<int, QVariant> QTextFormat::properties() const
Gibt eine Karte mit allen Eigenschaften dieses Textformats zurück.
QVariant QTextFormat::property(int propertyId) const
Gibt die durch die angegebene propertyId angegebene Eigenschaft zurück.
Siehe auch setProperty() und Property.
int QTextFormat::propertyCount() const
Gibt die Anzahl der im Format gespeicherten Eigenschaften zurück.
void QTextFormat::setBackground(const QBrush &brush)
Setzt den Pinsel, mit dem der Hintergrund des Dokuments gemalt wird, auf die angegebene brush.
Siehe auch background(), clearBackground(), und setForeground().
void QTextFormat::setForeground(const QBrush &brush)
Setzt den Vordergrundpinsel auf den angegebenen brush. Der Vordergrundpinsel wird meist zur Darstellung von Text verwendet.
Siehe auch foreground(), clearForeground(), und setBackground().
void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)
Setzt die Layout-Richtung des Dokuments auf die angegebene direction.
Siehe auch layoutDirection().
void QTextFormat::setObjectIndex(int index)
Setzt das Objekt des Format-Objekts index.
Siehe auch objectIndex().
void QTextFormat::setObjectType(int type)
Setzt den Objekttyp des Textformats auf type.
Siehe auch ObjectTypes und objectType().
void QTextFormat::setProperty(int propertyId, const QList<QTextLength> &value)
Setzt den Wert der durch propertyId angegebenen Eigenschaft auf value.
Siehe auch property(), lengthVectorProperty(), und Property.
void QTextFormat::setProperty(int propertyId, const QVariant &value)
Setzt die durch propertyId angegebene Eigenschaft auf die angegebene value.
Siehe auch Property.
QString QTextFormat::stringProperty(int propertyId) const
Gibt den Wert der durch propertyId angegebenen Eigenschaft zurück; wenn die Eigenschaft nicht vom Typ QMetaType::QString ist, wird stattdessen ein leerer String zurückgegeben.
Siehe auch setProperty(), boolProperty(), intProperty(), doubleProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), und Property.
void QTextFormat::swap(QTextFormat &other)
Tauscht dieses Textformat mit other aus. Dieser Vorgang ist sehr schnell und schlägt nie fehl.
QTextBlockFormat QTextFormat::toBlockFormat() const
Gibt dieses Format als Blockformat zurück.
QTextCharFormat QTextFormat::toCharFormat() const
Gibt dieses Format als Zeichenformat zurück.
QTextFrameFormat QTextFormat::toFrameFormat() const
Gibt dieses Format als Rahmenformat zurück.
QTextImageFormat QTextFormat::toImageFormat() const
Gibt dieses Format als Bildformat zurück.
QTextListFormat QTextFormat::toListFormat() const
Gibt dieses Format als Listenformat zurück.
QTextTableCellFormat QTextFormat::toTableCellFormat() const
Gibt dieses Format als Tabellenzellenformat zurück.
QTextTableFormat QTextFormat::toTableFormat() const
Gibt dieses Format als Tabellenformat zurück.
int QTextFormat::type() const
Gibt den Typ dieses Formats zurück.
Siehe auch FormatType.
QVariant QTextFormat::operator QVariant() const
Gibt das Textformat als QVariant
bool QTextFormat::operator!=(const QTextFormat &other) const
Gibt true
zurück, wenn sich dieses Textformat vom Textformat other unterscheidet.
QTextFormat &QTextFormat::operator=(const QTextFormat &other)
Weist das Textformat other diesem Textformat zu und gibt einen Verweis auf dieses Textformat zurück.
bool QTextFormat::operator==(const QTextFormat &other) const
Gibt true
zurück, wenn dieses Textformat mit dem other Textformat identisch ist.
© 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.