QUndoView Class
The QUndoView class displays the contents of a QUndoStack. More...
Header: | #include <QUndoView> |
qmake: | QT += widgets |
Since: | Qt 4.2 |
Inherits: | QListView |
This class was introduced in Qt 4.2.
Properties
- cleanIcon : QIcon
- emptyLabel : QString
- 14 properties inherited from QListView
- 16 properties inherited from QAbstractItemView
- 3 properties inherited from QAbstractScrollArea
- 6 properties inherited from QFrame
- 59 properties inherited from QWidget
- 1 property inherited from QObject
Public Functions
QUndoView(QUndoGroup *group, QWidget *parent = nullptr) | |
QUndoView(QUndoStack *stack, QWidget *parent = nullptr) | |
QUndoView(QWidget *parent = nullptr) | |
virtual | ~QUndoView() |
QIcon | cleanIcon() const |
QString | emptyLabel() const |
QUndoGroup * | group() const |
void | setCleanIcon(const QIcon &icon) |
void | setEmptyLabel(const QString &label) |
QUndoStack * | stack() const |
- 34 public functions inherited from QListView
- 60 public functions inherited from QAbstractItemView
- 20 public functions inherited from QAbstractScrollArea
- 14 public functions inherited from QFrame
- 214 public functions inherited from QWidget
- 30 public functions inherited from QObject
- 14 public functions inherited from QPaintDevice
Public Slots
- 9 public slots inherited from QAbstractItemView
- 19 public slots inherited from QWidget
- 1 public slot inherited from QObject
Related Non-Members
typedef | QObjectList |
QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
T | qobject_cast(QObject *object) |
T | qobject_cast(const QObject *object) |
Macros
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
QWIDGETSIZE_MAX | |
Q_CLASSINFO(Name, Value) | |
Q_DISABLE_COPY(Class) | |
Q_DISABLE_COPY_MOVE(Class) | |
Q_DISABLE_MOVE(Class) | |
Q_EMIT | |
Q_ENUM(...) | |
Q_ENUM_NS(...) | |
Q_FLAG(...) | |
Q_FLAG_NS(...) | |
Q_GADGET | |
Q_INTERFACES(...) | |
Q_INVOKABLE | |
Q_NAMESPACE | |
Q_OBJECT | |
Q_PROPERTY(...) | |
Q_REVISION | |
Q_SET_OBJECT_NAME(Object) | |
Q_SIGNAL | |
Q_SIGNALS | |
Q_SLOT | |
Q_SLOTS |
Additional Inherited Members
- 1 signal inherited from QListView
- 7 signals inherited from QAbstractItemView
- 3 signals inherited from QWidget
- 2 signals inherited from QObject
- 5 static public members inherited from QWidget
- 9 static public members inherited from QObject
- 28 protected functions inherited from QListView
- 38 protected functions inherited from QAbstractItemView
- 20 protected functions inherited from QAbstractScrollArea
- 4 protected functions inherited from QFrame
- 35 protected functions inherited from QWidget
- 9 protected functions inherited from QObject
- 1 protected function inherited from QPaintDevice
- 9 protected slots inherited from QAbstractItemView
- 1 protected slot inherited from QWidget
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 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.
Property Documentation
cleanIcon : QIcon
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:
QIcon | cleanIcon() const |
void | setCleanIcon(const QIcon &icon) |
emptyLabel : QString
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:
QString | emptyLabel() const |
void | setEmptyLabel(const QString &label) |
Member Function Documentation
QUndoView::QUndoView(QUndoGroup *group, QWidget *parent = nullptr)
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.
QUndoView::QUndoView(QUndoStack *stack, QWidget *parent = nullptr)
Constructs a new view with parent parent and sets the observed stack to stack.
QUndoView::QUndoView(QWidget *parent = nullptr)
Constructs a new view with parent parent.
[slot]
void QUndoView::setGroup(QUndoGroup *group)
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().
[slot]
void QUndoView::setStack(QUndoStack *stack)
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().
[virtual]
QUndoView::~QUndoView()
Destroys this view.
QUndoGroup *QUndoView::group() const
Returns the group displayed by this view.
If the view is not looking at group, this function returns nullptr
.
See also setGroup() and setStack().
QUndoStack *QUndoView::stack() const
Returns the stack currently displayed by this view. If the view is looking at a QUndoGroup, this the group's active stack.