|  | Home · All Classes · Modules

# QUndoView Class Reference
[QtGui module]

The QUndoView class displays the contents of a QUndoStack. More...

Inherits QListView.

### Methods

- __init__ (self, QWidget parent = None)
- __init__ (self, QUndoStack, QWidget parent = None)
- __init__ (self, QUndoGroup, QWidget parent = None)
- QIcon cleanIcon (self)
- QString emptyLabel (self)
- QUndoGroup group (self)
- setCleanIcon (self, QIcon)
- setEmptyLabel (self, QString)
- setGroup (self, QUndoGroup)
- setStack (self, QUndoStack)
- QUndoStack stack (self)

## Detailed Description

The QUndoView class displays the contents of a QUndoStack.

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 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 with setGroup(). The view will then update itself automatically whenever the active stack of the group changes.

## Method Documentation

### QUndoView.__init__ (self, QWidget parent = None)

The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

Constructs a new view with parent parent.

### QUndoView.__init__ (self, QUndoStack, QWidget parent = None)

The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

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

### QUndoView.__init__ (self, QUndoGroup, QWidget parent = None)

The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

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.

### QIcon QUndoView.cleanIcon (self)

### QString QUndoView.emptyLabel (self)

### QUndoGroup QUndoView.group (self)

Returns the group displayed by this view.

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

See also setGroup() and setStack().

### QUndoView.setCleanIcon (self, QIcon)

### QUndoView.setEmptyLabel (self, QString)

### QUndoView.setGroup (self, QUndoGroup)

This method is also a Qt slot with the C++ signature `void setGroup(QUndoGroup *)`.

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

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

See also group() and setStack().

### QUndoView.setStack (self, QUndoStack)

This method is also a Qt slot with the C++ signature `void setStack(QUndoStack *)`.

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

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

See also stack() and setGroup().

### QUndoStack QUndoView.stack (self)

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

See also setStack() and setGroup().