- class QUndoView¶
The
QUndoView
class displays the contents of a QUndoStack. More…Synopsis¶
Properties¶
cleanIconᅟ
- The icon used to represent the clean stateemptyLabelᅟ
- The label used for the empty state
Methods¶
def
__init__()
def
cleanIcon()
def
emptyLabel()
def
group()
def
setCleanIcon()
def
setEmptyLabel()
def
stack()
Slots¶
def
setGroup()
def
setStack()
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 aQListView
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 QUndoStack::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 withsetGroup()
. The view will then update itself automatically whenever the active stack of the group changes.Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.This property holds the icon used to represent the clean state..
A stack may have a clean state set with QUndoStack::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 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:
Constructs a new view with parent
parent
.- __init__(group[, parent=None])
- Parameters:
group –
QUndoGroup
parent –
QWidget
Constructs a new view with parent
parent
and sets the observed group togroup
.The view will update itself autmiatically whenever the active stack of the group changes.
- __init__(stack[, parent=None])
- Parameters:
stack –
QUndoStack
parent –
QWidget
Constructs a new view with parent
parent
and sets the observed stack tostack
.- cleanIcon()¶
- Return type:
See also
Getter of property
cleanIconᅟ
.- emptyLabel()¶
- Return type:
str
See also
Getter of property
emptyLabelᅟ
.- group()¶
- Return type:
Returns the group displayed by this view.
If the view is not looking at group, this function returns
None
.See also
Setter of property
cleanIconᅟ
.- setEmptyLabel(label)¶
- Parameters:
label – str
See also
Setter of property
emptyLabelᅟ
.- setGroup(group)¶
- Parameters:
group –
QUndoGroup
Sets the group displayed by this view to
group
. Ifgroup
isNone
, the view will be empty.The view will update itself automatically whenever the active stack of the group changes.
See also
- setStack(stack)¶
- Parameters:
stack –
QUndoStack
Sets the stack displayed by this view to
stack
. Ifstack
isNone
, the view will be empty.If the view was previously looking at a QUndoGroup, the group is set to
None
.See also
- stack()¶
- Return type:
Returns the stack currently displayed by this view. If the view is looking at a QUndoGroup, this the group’s active stack.
See also