Skip to content

UndoView

Base classes

Name Children Inherits
ListViewMixin
prettyqt.widgets.listview
QUndoView
PySide6.QtWidgets
QUndoView(self, group: PySide6.QtGui.QUndoGroup, /, parent: PySide6.QtWidgets.QWidget | None \= None, *, emptyLabel: str | None \= None, cleanIcon: PySide6.QtGui.QIcon | None \= None) -> None

⋔ Inheritance diagram

graph TD
  214959670["widgets.UndoView"]
  2269893456["widgets.ListViewMixin"]
  3836649406["widgets.AbstractItemViewMixin"]
  1259044718["widgets.AbstractScrollAreaMixin"]
  1689631995["widgets.FrameMixin"]
  829357528["widgets.WidgetMixin"]
  3227531497["core.ObjectMixin"]
  2751680898["builtins.object"]
  625385617["gui.PaintDeviceMixin"]
  2107962883["QtWidgets.QUndoView"]
  3524556349["QtWidgets.QListView"]
  3038536384["QtWidgets.QAbstractItemView"]
  1459025998["QtWidgets.QAbstractScrollArea"]
  3822057598["QtWidgets.QFrame"]
  3620195106["QtWidgets.QWidget"]
  3984060476["QtCore.QObject"]
  37984305["Shiboken.Object"]
  673956333["QtGui.QPaintDevice"]
  2269893456 --> 214959670
  3836649406 --> 2269893456
  1259044718 --> 3836649406
  1689631995 --> 1259044718
  829357528 --> 1689631995
  3227531497 --> 829357528
  2751680898 --> 3227531497
  625385617 --> 829357528
  2751680898 --> 625385617
  2751680898 --> 829357528
  2751680898 --> 1689631995
  2751680898 --> 1259044718
  2751680898 --> 3836649406
  2751680898 --> 2269893456
  2107962883 --> 214959670
  3524556349 --> 2107962883
  3038536384 --> 3524556349
  1459025998 --> 3038536384
  3822057598 --> 1459025998
  3620195106 --> 3822057598
  3984060476 --> 3620195106
  37984305 --> 3984060476
  2751680898 --> 37984305
  673956333 --> 3620195106
  37984305 --> 673956333

🛈 DocStrings

Bases: ListViewMixin, QUndoView

Displays the contents of a QUndoStack.

Source code in prettyqt/widgets/undoview.py
class UndoView(widgets.ListViewMixin, widgets.QUndoView):
    """Displays the contents of a QUndoStack."""

    def __getitem__(self, index: int) -> gui.QUndoCommand:
        return self.stack().command(index)

    def set_clean_icon(self, icon: datatypes.IconType):
        """Set the icon for the clean button.

        Args:
            icon: icon to use
        """
        icon = iconprovider.get_icon(icon)
        self.setCleanIcon(icon)

    def set_value(self, value: gui.QUndoGroup | gui.QUndoStack):
        if isinstance(value, gui.QUndoGroup):
            self.setGroup(value)
        else:
            self.setStack(value)

set_clean_icon(icon: datatypes.IconType)

Set the icon for the clean button.

Parameters:

Name Type Description Default
icon IconType

icon to use

required
Source code in prettyqt/widgets/undoview.py
def set_clean_icon(self, icon: datatypes.IconType):
    """Set the icon for the clean button.

    Args:
        icon: icon to use
    """
    icon = iconprovider.get_icon(icon)
    self.setCleanIcon(icon)

:fa-brands-github: Show source on GitHub