Skip to content

TextTableFormat

Qt Base Class: QTextTableFormat

Signature: QTextTableFormat(self) -> None QTextTableFormat(self, QTextTableFormat: PySide6.QtGui.QTextTableFormat) -> None QTextTableFormat(self, fmt: PySide6.QtGui.QTextFormat) -> None

Base classes

Name Children Inherits
TextFrameFormatMixin
prettyqt.gui.textframeformat
QTextTableFormat
PySide6.QtGui
QTextTableFormat(self) -> None

⋔ Inheritance diagram

graph TD
  1473245663648["gui.TextTableFormat"]
  1473245648032["gui.TextFrameFormatMixin"]
  1473245646080["gui.TextFormatMixin"]
  140713234304496["builtins.object"]
  1473299714496["QtGui.QTextTableFormat"]
  1473299696928["QtGui.QTextFrameFormat"]
  1473299700832["QtGui.QTextFormat"]
  1473291690208["Shiboken.Object"]
  1473245648032 --> 1473245663648
  1473245646080 --> 1473245648032
  140713234304496 --> 1473245646080
  1473299714496 --> 1473245663648
  1473299696928 --> 1473299714496
  1473299700832 --> 1473299696928
  1473291690208 --> 1473299700832
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: TextFrameFormatMixin, QTextTableFormat

Source code in prettyqt\gui\texttableformat.py
class TextTableFormat(gui.textframeformat.TextFrameFormatMixin, gui.QTextTableFormat):
    def __bool__(self):
        return self.isValid()

    def set_alignment(self, alignment: constants.AlignmentStr | constants.AlignmentFlag):
        """Set the alignment of the format.

        Args:
            alignment: alignment for the format
        """
        self.setAlignment(constants.ALIGNMENTS.get_enum_value(alignment))

    def get_alignment(self) -> constants.AlignmentStr:
        """Return current alignment.

        Returns:
            alignment
        """
        return constants.ALIGNMENTS.inverse[self.alignment()]

    def get_column_width_constraints(self) -> list[gui.TextLength]:
        return [gui.TextLength(i) for i in self.columnWidthConstraints()]

get_alignment() -> constants.AlignmentStr

Return current alignment.

Source code in prettyqt\gui\texttableformat.py
def get_alignment(self) -> constants.AlignmentStr:
    """Return current alignment.

    Returns:
        alignment
    """
    return constants.ALIGNMENTS.inverse[self.alignment()]

set_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag)

Set the alignment of the format.

Parameters:

Name Type Description Default
alignment AlignmentStr | AlignmentFlag

alignment for the format

required
Source code in prettyqt\gui\texttableformat.py
def set_alignment(self, alignment: constants.AlignmentStr | constants.AlignmentFlag):
    """Set the alignment of the format.

    Args:
        alignment: alignment for the format
    """
    self.setAlignment(constants.ALIGNMENTS.get_enum_value(alignment))