QUndoView#

The QUndoView class displays the contents of a QUndoStack . More

Inheritance diagram of PySide6.QtWidgets.QUndoView

Synopsis#

Properties#

  • cleanIcon - The icon used to represent the clean state

  • emptyLabel - The label used for the empty state

Functions#

Slots#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

QUndoView is a QListView which displays the list of commands pushed on an undo stack. The most recently executed command is always selected. Selecting a different command results in a call to setIndex() , rolling the state of the document backwards or forward to the new command.

The stack can be set explicitly with setStack() . Alternatively, a QUndoGroup object can be set with setGroup() . The view will then update itself automatically whenever the active stack of the group changes.

../../_images/qundoview.png
class PySide6.QtWidgets.QUndoView(group[, parent=None])#

PySide6.QtWidgets.QUndoView(stack[, parent=None])

PySide6.QtWidgets.QUndoView([parent=None])

Parameters:

Constructs a new view with parent parent and sets the observed group to group.

The view will update itself autmiatically whenever the active stack of the group changes.

Constructs a new view with parent parent and sets the observed stack to stack.

Constructs a new view with parent parent.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtWidgets.QUndoView.cleanIcon: PySide6.QtGui.QIcon#

This property holds the icon used to represent the clean state..

A stack may have a clean state set with setClean() . This is usually the state of the document at the point it was saved. QUndoView can display an icon in the list of commands to show the clean state. If this property is a null icon, no icon is shown. The default value is the null icon.

Access functions:
property PᅟySide6.QtWidgets.QUndoView.emptyLabel: str#

This property holds the label used for the empty state..

The empty label is the topmost element in the list of commands, which represents the state of the document before any commands were pushed on the stack. The default is the string “<empty>”.

Access functions:
PySide6.QtWidgets.QUndoView.cleanIcon()#
Return type:

PySide6.QtGui.QIcon

See also

setCleanIcon()

Getter of property cleanIcon .

PySide6.QtWidgets.QUndoView.emptyLabel()#
Return type:

str

See also

setEmptyLabel()

Getter of property emptyLabel .

PySide6.QtWidgets.QUndoView.group()#
Return type:

PySide6.QtGui.QUndoGroup

Returns the group displayed by this view.

If the view is not looking at group, this function returns None.

PySide6.QtWidgets.QUndoView.setCleanIcon(icon)#
Parameters:

iconPySide6.QtGui.QIcon

See also

cleanIcon()

Setter of property cleanIcon .

PySide6.QtWidgets.QUndoView.setEmptyLabel(label)#
Parameters:

label – str

See also

emptyLabel()

Setter of property emptyLabel .

PySide6.QtWidgets.QUndoView.setGroup(group)#
Parameters:

groupPySide6.QtGui.QUndoGroup

Sets the group displayed by this view to group. If group is None, the view will be empty.

The view will update itself automatically whenever the active stack of the group changes.

See also

group() setStack()

PySide6.QtWidgets.QUndoView.setStack(stack)#
Parameters:

stackPySide6.QtGui.QUndoStack

Sets the stack displayed by this view to stack. If stack is None, the view will be empty.

If the view was previously looking at a QUndoGroup , the group is set to None.

See also

stack() setGroup()

PySide6.QtWidgets.QUndoView.stack()#
Return type:

PySide6.QtGui.QUndoStack

Returns the stack currently displayed by this view. If the view is looking at a QUndoGroup , this the group’s active stack.