Skip to content

BaseXmlModel

Qt Base Class: QAbstractItemModel

Signature: QAbstractItemModel(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ColumnItemModel
prettyqt.itemmodels.columnitemmodel

Subclasses

Class Module Description
XmlModel prettyqt.itemmodels.xmlmodel

⋔ Inheritance diagram

graph TD
  1473245482112["itemmodels.BaseXmlModel"]
  1473245677312["itemmodels.ColumnItemModel"]
  1473245682192["itemmodels.ColumnItemModelMixin"]
  140713234304496["builtins.object"]
  1473299686192["itemmodels.TreeModel"]
  1473299893104["core.AbstractItemModel"]
  1473299890176["core.AbstractItemModelMixin"]
  1473299815024["core.ObjectMixin"]
  1473289050128["QtCore.QAbstractItemModel"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473245677312 --> 1473245482112
  1473245682192 --> 1473245677312
  140713234304496 --> 1473245682192
  1473299686192 --> 1473245677312
  1473299893104 --> 1473299686192
  1473299890176 --> 1473299893104
  1473299815024 --> 1473299890176
  140713234304496 --> 1473299815024
  1473289050128 --> 1473299893104
  1473288842240 --> 1473289050128
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ColumnItemModel

Source code in prettyqt\itemmodels\xmlmodel.py
class BaseXmlModel(itemmodels.ColumnItemModel):
    ICON = "mdi.xml"
    COLUMNS = [TagColumn, TextColumn, TailColumn, AttributeColumn]

    def __init__(self, obj, **kwargs):
        super().__init__(obj=obj, columns=self.COLUMNS, show_root=True, **kwargs)

    class Roles(enum.IntEnum):
        NodeRole = constants.USER_ROLE + 24245

    def _has_children(self, item: XmlModel.TreeItem) -> bool:
        return len(item.obj) > 0

    def _fetch_object_children(self, item: XmlModel.TreeItem) -> list[XmlModel.TreeItem]:
        return [self.TreeItem(obj=i) for i in item.obj]

⌗ Property table

Qt Property Type Doc
objectName QString