Skip to content

PythonQt.QtGui.QTextBlockFormat

QTextBlockFormat

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

A document is composed of a list of blocks, represented by QTextBlock objects. Each block can contain an item of some kind, such as a paragraph of text, a table, a list, or an image. Every block has an associated QTextBlockFormat that specifies its characteristics.

To cater for left-to-right and right-to-left languages you can set a block's direction with setLayoutDirection(). Paragraph alignment is set with setAlignment(). Margins are controlled by setTopMargin(), setBottomMargin(), setLeftMargin(), setRightMargin(). Overall indentation is set with setIndent(), the indentation of the first line with setTextIndent().

Line spacing is set with setLineHeight() and retrieved via lineHeight() and lineHeightType(). The types of line spacing available are in the LineHeightTypes enum.

Line breaking can be enabled and disabled with setNonBreakableLines().

The brush used to paint the paragraph's background is set with setBackground(), and other aspects of the text's appearance can be customized by using the setProperty() function with the OutlinePen, ForegroundBrush, and BackgroundBrush QTextFormat::Property values.

If a text block is part of a list, it can also have a list format that is accessible with the listFormat() function.

Source: https://doc.qt.io/archives/qt-5.15/qtextblockformat.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
AnchorHref attribute Any
AnchorName attribute Any
BackgroundBrush attribute Any
BackgroundImageUrl attribute Any
BlockAlignment attribute Any
BlockBottomMargin attribute Any
BlockFormat attribute Any
BlockIndent attribute Any
BlockLeftMargin attribute Any
BlockNonBreakableLines attribute Any
BlockRightMargin attribute Any
BlockTopMargin attribute Any
BlockTrailingHorizontalRulerWidth attribute Any
CharFormat attribute Any
CssFloat attribute Any
FirstFontProperty attribute Any
FixedHeight attribute Any
FontCapitalization attribute Any
FontFamily attribute Any
FontFixedPitch attribute Any
FontHintingPreference attribute Any
FontItalic attribute Any
FontKerning attribute Any
FontLetterSpacing attribute Any
FontLetterSpacingType attribute Any
FontOverline attribute Any
FontPixelSize attribute Any
FontPointSize attribute Any
FontSizeAdjustment attribute Any
FontSizeIncrement attribute Any
FontStretch attribute Any
FontStrikeOut attribute Any
FontStyleHint attribute Any
FontStyleStrategy attribute Any
FontUnderline attribute Any
FontWeight attribute Any
FontWordSpacing attribute Any
ForegroundBrush attribute Any
FormatType attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
FrameBorder attribute Any
FrameBorderBrush attribute Any
FrameBorderStyle attribute Any
FrameBottomMargin attribute Any
FrameFormat attribute Any
FrameHeight attribute Any
FrameLeftMargin attribute Any
FrameMargin attribute Any
FramePadding attribute Any
FrameRightMargin attribute Any
FrameTopMargin attribute Any
FrameWidth attribute Any
FullWidthSelection attribute Any
ImageHeight attribute Any
ImageName attribute Any
ImageObject attribute Any
ImageWidth attribute Any
InvalidFormat attribute Any (shared captured text)
IsAnchor attribute Any
LastFontProperty attribute Any
LayoutDirection attribute Any
LineDistanceHeight attribute Any
LineHeight attribute Any
LineHeightType attribute Any
LineHeightTypes attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
ListFormat attribute Any
ListIndent attribute Any
ListNumberPrefix attribute Any
ListNumberSuffix attribute Any
ListStyle attribute Any
MinimumHeight attribute Any
NoObject attribute Any
ObjectIndex attribute Any
ObjectType attribute Any
ObjectTypes attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
OutlinePen attribute Any
PageBreakFlag attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
PageBreakFlags attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
PageBreakPolicy attribute Any
PageBreak_AlwaysAfter attribute Any
PageBreak_AlwaysBefore attribute Any
PageBreak_Auto attribute Any
Property attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
ProportionalHeight attribute Any
SingleHeight attribute Any
TabPositions attribute Any
TableCellBottomPadding attribute Any
TableCellColumnSpan attribute Any
TableCellLeftPadding attribute Any
TableCellObject attribute Any
TableCellPadding attribute Any
TableCellRightPadding attribute Any
TableCellRowSpan attribute Any
TableCellSpacing attribute Any
TableCellTopPadding attribute Any
TableColumnWidthConstraints attribute Any
TableColumns attribute Any
TableFormat attribute Any
TableHeaderRowCount attribute Any
TableObject attribute Any
TextIndent attribute Any
TextOutline attribute Any
TextToolTip attribute Any
TextUnderlineColor attribute Any
TextUnderlineStyle attribute Any
TextVerticalAlignment attribute Any
UserFormat attribute Any
UserObject attribute Any
UserProperty attribute Any
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
alignment function (self) -> Any Returns the paragraph's alignment.
background function (self) -> Any X.background() -> PythonQt.QtGui.QBrush (shared captured text)
boolProperty function (self, propertyId: Any) -> bool X.boolProperty(propertyId) -> bool
bottomMargin function (self) -> float X.bottomMargin() -> float
brushProperty function (self, propertyId: Any) -> Any X.brushProperty(propertyId) -> PythonQt.QtGui.QBrush
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
clearBackground function (self) -> Any
clearForeground function (self) -> Any
clearProperty function (self, propertyId: Any) -> Any
colorProperty function (self, propertyId: Any) -> Any X.colorProperty(propertyId) -> PythonQt.QtGui.QColor
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
doubleProperty function (self, propertyId: Any) -> float X.doubleProperty(propertyId) -> float
foreground function (self) -> Any X.foreground() -> PythonQt.QtGui.QBrush
hasProperty function (self, propertyId: Any) -> bool X.hasProperty(propertyId) -> bool
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
indent function (self) -> int X.indent() -> int
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
intProperty function (self, propertyId: Any) -> int X.intProperty(propertyId) -> int
isBlockFormat function (self) -> bool X.isBlockFormat() -> bool
isCharFormat function (self) -> bool X.isCharFormat() -> bool
isEmpty function (self) -> bool X.isEmpty() -> bool (shared captured text)
isFrameFormat function (self) -> bool X.isFrameFormat() -> bool
isImageFormat function (self) -> bool X.isImageFormat() -> bool
isListFormat function (self) -> bool X.isListFormat() -> bool
isTableCellFormat function (self) -> bool X.isTableCellFormat() -> bool
isTableFormat function (self) -> bool X.isTableFormat() -> bool
isValid function (self) -> bool X.isValid() -> bool
layoutDirection function (self) -> Any (shared captured text)
leftMargin function (self) -> float X.leftMargin() -> float
lengthProperty function (self, propertyId: Any) -> Any X.lengthProperty(propertyId) -> PythonQt.QtGui.QTextLength
lengthVectorProperty function (self, propertyId: Any) -> tuple X.lengthVectorProperty(propertyId) -> tuple
lineHeight function (self, scriptLineHeight: Any, scaling: Any) -> float X.lineHeight(scriptLineHeight, scaling) -> float
lineHeightType function (self) -> int X.lineHeightType() -> int
merge function (self, other: Any) -> Any
nonBreakableLines function (self) -> bool X.nonBreakableLines() -> bool
objectIndex function (self) -> int X.objectIndex() -> int
objectType function (self) -> int X.objectType() -> int
pageBreakPolicy function (self) -> Any Returns the currently set page break policy for the paragraph.
penProperty function (self, propertyId: Any) -> Any X.penProperty(propertyId) -> PythonQt.QtGui.QPen
properties function (self) -> dict X.properties() -> dict
property function (self, propertyId: Any) -> Any X.property(propertyId) -> object
propertyCount function (self) -> int X.propertyCount() -> int
readFrom function (self, arg__1: Any) -> Any (shared captured text)
rightMargin function (self) -> float X.rightMargin() -> float
setAlignment function (self, alignment: Any) -> None Sets the paragraph's alignment.
setBackground function (self, brush: Any) -> Any
setBottomMargin function (self, margin: float) -> None Sets the paragraph's bottom margin.
setForeground function (self, brush: Any) -> Any
setIndent function (self, indent: int) -> None Sets the paragraph's indentation.
setLayoutDirection function (self, direction: Any) -> Any (shared captured text)
setLeftMargin function (self, margin: float) -> None Sets the paragraph's left margin.
setLineHeight function (self, height: float, heightType: int) -> None X.setLineHeight(height, heightType)
setNonBreakableLines function (self, b: bool) -> None If b is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.
setObjectIndex function (self, object: Any) -> Any
setObjectType function (self, type: Any) -> Any
setPageBreakPolicy function (self, arg0: flags) -> None Sets the page break policy for the paragraph to policy.
setProperty function (self, propertyId: Any, value: Any) -> Any X.setProperty(propertyId, value)
setRightMargin function (self, margin: float) -> None Sets the paragraph's right margin.
setTabPositions function (self, tabs: Any) -> None Sets the tab positions for the text block to those specified by tabs.
setTextIndent function (self, aindent: float) -> None Sets the indent for the first line in the block.
setTopMargin function (self, margin: float) -> None Sets the paragraph's top margin.
stringProperty function (self, propertyId: Any) -> str X.stringProperty(propertyId) -> str
swap function (self, other: Any) -> Any
tabPositions function (self) -> tuple X.tabPositions() -> tuple
textIndent function (self) -> float X.textIndent() -> float
toBlockFormat function (self) -> Any X.toBlockFormat() -> PythonQt.QtGui.QTextBlockFormat
toCharFormat function (self) -> Any X.toCharFormat() -> PythonQt.QtGui.QTextCharFormat
toFrameFormat function (self) -> Any X.toFrameFormat() -> PythonQt.QtGui.QTextFrameFormat
toImageFormat function (self) -> Any X.toImageFormat() -> PythonQt.QtGui.QTextImageFormat
toListFormat function (self) -> Any X.toListFormat() -> PythonQt.QtGui.QTextListFormat
toTableCellFormat function (self) -> Any X.toTableCellFormat() -> PythonQt.QtGui.QTextTableCellFormat
toTableFormat function (self) -> Any X.toTableFormat() -> PythonQt.QtGui.QTextTableFormat
topMargin function (self) -> float X.topMargin() -> float
type function (self) -> int X.type() -> int (shared captured text)
writeTo function (self, arg__1: Any) -> Any (shared captured text)