Class: QgsTextCharacterFormat¶
-
class
qgis.core.
QgsTextCharacterFormat
¶ Bases:
sip.wrapper
Constructor for QgsTextCharacterFormat.
QgsTextCharacterFormat(format: QTextCharFormat) Constructor for
QgsTextCharacterFormat
, based on the specified QTextCharFormatformat
.QgsTextCharacterFormat(
QgsTextCharacterFormat
)Stores information relating to individual character formatting.
These options encapsulate formatting options which override the default settings from a
QgsTextFormat
for individual characters (or sets of characters).Warning
This API is not considered stable and may change in future QGIS versions.
New in version 3.14: Enums
Bases:
enum.IntEnum
Methods
Returns whether the format has overline enabled.
Sets whether the format has overline
enabled
.Sets whether the format has strikethrough
enabled
.Sets the character’s text
color
.Sets whether the format has underline
enabled
.Returns whether the format has strikethrough enabled.
Returns the character’s text color, or an invalid color if no color override is set and the default format color should be used.
Returns whether the format has underline enabled.
Updates the specified
font
in place, applying character formatting options which are applicable on a font level.-
class
BooleanValue
(value)¶ Bases:
enum.IntEnum
Status values for boolean format properties
NotSet
: Property is not setSetTrue
: Property is set andTrue
SetFalse
: Property is set andFalse
-
NotSet
= 0¶
-
SetFalse
= 2¶
-
SetTrue
= 1¶
-
overline
(self) → QgsTextCharacterFormat.BooleanValue¶ Returns whether the format has overline enabled.
See also
- Return type
-
setOverline
(self, enabled: QgsTextCharacterFormat.BooleanValue)¶ Sets whether the format has overline
enabled
.See also
- Parameters
enabled (QgsTextCharacterFormat.BooleanValue) –
-
setStrikeOut
(self, enabled: QgsTextCharacterFormat.BooleanValue)¶ Sets whether the format has strikethrough
enabled
.See also
- Parameters
enabled (QgsTextCharacterFormat.BooleanValue) –
-
setTextColor
(self, textColor: Union[QColor, Qt.GlobalColor])¶ Sets the character’s text
color
.Set
color
to an invalid color if no color override is desired and the default format color should be used.See also
- Parameters
textColor (Union[QColor) –
-
setUnderline
(self, enabled: QgsTextCharacterFormat.BooleanValue)¶ Sets whether the format has underline
enabled
.See also
- Parameters
enabled (QgsTextCharacterFormat.BooleanValue) –
-
strikeOut
(self) → QgsTextCharacterFormat.BooleanValue¶ Returns whether the format has strikethrough enabled.
See also
- Return type
-
textColor
(self) → QColor¶ Returns the character’s text color, or an invalid color if no color override is set and the default format color should be used.
See also
- Return type
QColor
-
underline
(self) → QgsTextCharacterFormat.BooleanValue¶ Returns whether the format has underline enabled.
See also
- Return type
-
updateFontForFormat
(self, font: QFont)¶ Updates the specified
font
in place, applying character formatting options which are applicable on a font level.- Parameters
font (QFont) –
-
class