|
Krita Source Code Documentation
|
The KUndo2View class displays the contents of a KUndo2QStack. More...
#include <kundo2view.h>
Inheritance diagram for KUndo2View:Public Slots | |
| void | setGroup (KUndo2Group *group) |
| void | setStack (KUndo2QStack *stack) |
Public Member Functions | |
| QIcon | cleanIcon () const |
| QString | emptyLabel () const |
| KUndo2Group * | group () const |
| KUndo2View (KUndo2Group *group, QWidget *parent=0) | |
| KUndo2View (KUndo2QStack *stack, QWidget *parent=0) | |
| KUndo2View (QWidget *parent=0) | |
| void | setCleanIcon (const QIcon &icon) |
| void | setEmptyLabel (const QString &label) |
| KUndo2QStack * | stack () const |
| ~KUndo2View () override | |
Properties | |
| QIcon | cleanIcon |
| the icon used to represent the clean state. | |
| QString | emptyLabel |
| the label used for the empty state. | |
Private Attributes | |
| KUndo2ViewPrivate *const | d |
The KUndo2View class displays the contents of a KUndo2QStack.
KUndo2View 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 KUndo2QStack::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.
Definition at line 61 of file kundo2view.h.
|
explicit |
Constructs a new view with parent parent.
Definition at line 107 of file kundo2view.cpp.
References d, and KUndo2ViewPrivate::init().
|
explicit |
Constructs a new view with parent parent and sets the observed stack to stack.
Definition at line 116 of file kundo2view.cpp.
References d, KUndo2ViewPrivate::init(), setStack(), and stack().
|
explicit |
Constructs a new view with parent parent and sets the observed group to group.
The view will update itself automatically whenever the active stack of the group changes.
Definition at line 130 of file kundo2view.cpp.
References d, group(), KUndo2ViewPrivate::init(), and setGroup().
|
override |
| QIcon KUndo2View::cleanIcon | ( | ) | const |
Definition at line 266 of file kundo2view.cpp.
References KUndo2Model::cleanIcon(), d, and KUndo2ViewPrivate::model.
| QString KUndo2View::emptyLabel | ( | ) | const |
Definition at line 243 of file kundo2view.cpp.
References d, KUndo2Model::emptyLabel(), and KUndo2ViewPrivate::model.
| KUndo2Group * KUndo2View::group | ( | ) | const |
Returns the group displayed by this view.
If the view is not looking at group, this function returns 0.
Definition at line 220 of file kundo2view.cpp.
References d, and KUndo2ViewPrivate::group.
| void KUndo2View::setCleanIcon | ( | const QIcon & | icon | ) |
Definition at line 259 of file kundo2view.cpp.
References d, KUndo2ViewPrivate::model, and KUndo2Model::setCleanIcon().
| void KUndo2View::setEmptyLabel | ( | const QString & | label | ) |
Definition at line 237 of file kundo2view.cpp.
References d, KUndo2ViewPrivate::model, and KUndo2Model::setEmptyLabel().
|
slot |
Sets the group displayed by this view to group. If group is 0, the view will be empty.
The view will update itself automatically whenever the active stack of the group changes.
Definition at line 189 of file kundo2view.cpp.
References connect(), d, KUndo2ViewPrivate::group, group(), KUndo2ViewPrivate::model, KUndo2Model::setStack(), and setStack().
|
slot |
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.
Definition at line 169 of file kundo2view.cpp.
References d, KUndo2ViewPrivate::model, setGroup(), KUndo2Model::setStack(), and stack().
| KUndo2QStack * KUndo2View::stack | ( | ) | const |
Returns the stack currently displayed by this view. If the view is looking at a QUndoGroup, this the group's active stack.
Definition at line 154 of file kundo2view.cpp.
References d, KUndo2ViewPrivate::model, and KUndo2Model::stack().
|
private |
Definition at line 93 of file kundo2view.h.
|
readwrite |
the icon used to represent the clean state.
A stack may have a clean state set with KUndo2QStack::setClean(). This is usually the state of the document at the point it was saved. KUndo2View 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.
Definition at line 65 of file kundo2view.h.
|
readwrite |
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>".
Definition at line 64 of file kundo2view.h.