Skip to content

TextTableFormat

Base classes

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

⋔ Inheritance diagram

graph TD
  2887520822["gui.TextTableFormat"]
  3443799232["gui.TextFrameFormatMixin"]
  1171567019["gui.TextFormatMixin"]
  2751680898["builtins.object"]
  480461113["QtGui.QTextTableFormat"]
  3548854915["QtGui.QTextFrameFormat"]
  1757385971["QtGui.QTextFormat"]
  37984305["Shiboken.Object"]
  3443799232 --> 2887520822
  1171567019 --> 3443799232
  2751680898 --> 1171567019
  2751680898 --> 3443799232
  480461113 --> 2887520822
  3548854915 --> 480461113
  1757385971 --> 3548854915
  37984305 --> 1757385971
  2751680898 --> 37984305

🛈 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))

:fa-brands-github: Show source on GitHub