|
Krita Source Code Documentation
|
The KisUndoView class displays the contents of a KUndo2QStack. More...
#include <KisUndoView.h>
Inheritance diagram for KisUndoView:Public Slots | |
| void | setGroup (KUndo2Group *group) |
| void | setStack (KUndo2QStack *stack) |
| void | slotScrollerStateChanged (QScroller::State state) |
Public Member Functions | |
| QIcon | cleanIcon () const |
| QString | emptyLabel () const |
| KUndo2Group * | group () const |
| KisUndoView (KUndo2Group *group, QWidget *parent=0) | |
| KisUndoView (KUndo2QStack *stack, QWidget *parent=0) | |
| KisUndoView (QWidget *parent=0) | |
| void | setCanvas (KisCanvas2 *canvas) |
| void | setCleanIcon (const QIcon &icon) |
| void | setEmptyLabel (const QString &label) |
| KUndo2QStack * | stack () const |
| ~KisUndoView () override | |
Properties | |
| QIcon | cleanIcon |
| the icon used to represent the clean state. | |
| QString | emptyLabel |
| the label used for the empty state. | |
Private Attributes | |
| KisUndoViewPrivate *const | d |
The KisUndoView class displays the contents of a KUndo2QStack.
KisUndoView 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 KUndo2Group object can be set with setGroup(). The view will then update itself automatically whenever the active stack of the group changes.
Definition at line 65 of file KisUndoView.h.
|
explicit |
Constructs a new view with parent parent.
Definition at line 112 of file KisUndoView.cpp.
References connect(), KisKineticScroller::createPreconfiguredScroller(), d, KisUndoViewPrivate::init(), and slotScrollerStateChanged().
|
explicit |
Constructs a new view with parent parent and sets the observed stack to stack.
Definition at line 129 of file KisUndoView.cpp.
References 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 143 of file KisUndoView.cpp.
References group(), and setGroup().
|
override |
| QIcon KisUndoView::cleanIcon | ( | ) | const |
Definition at line 280 of file KisUndoView.cpp.
References KisUndoModel::cleanIcon(), d, and KisUndoViewPrivate::model.
| QString KisUndoView::emptyLabel | ( | ) | const |
Definition at line 257 of file KisUndoView.cpp.
References d, KisUndoModel::emptyLabel(), and KisUndoViewPrivate::model.
| KUndo2Group * KisUndoView::group | ( | ) | const |
Returns the group displayed by this view.
If the view is not looking at group, this function returns 0.
Definition at line 234 of file KisUndoView.cpp.
References d, and KisUndoViewPrivate::group.
| void KisUndoView::setCanvas | ( | KisCanvas2 * | canvas | ) |
Definition at line 286 of file KisUndoView.cpp.
References d, KisUndoViewPrivate::model, and KisUndoModel::setCanvas().
| void KisUndoView::setCleanIcon | ( | const QIcon & | icon | ) |
Definition at line 273 of file KisUndoView.cpp.
References d, KisUndoViewPrivate::model, and KisUndoModel::setCleanIcon().
| void KisUndoView::setEmptyLabel | ( | const QString & | label | ) |
Definition at line 251 of file KisUndoView.cpp.
References d, KisUndoViewPrivate::model, and KisUndoModel::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 203 of file KisUndoView.cpp.
References connect(), d, KisUndoViewPrivate::group, group(), KisUndoViewPrivate::model, KisUndoModel::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 KUndo2Group, the group is set to 0.
Definition at line 183 of file KisUndoView.cpp.
References d, KisUndoViewPrivate::model, setGroup(), KisUndoModel::setStack(), and stack().
|
inlineslot |
Definition at line 98 of file KisUndoView.h.
References KisKineticScroller::updateCursor().
| KUndo2QStack * KisUndoView::stack | ( | ) | const |
Returns the stack currently displayed by this view. If the view is looking at a KUndo2Group, this the group's active stack.
Definition at line 168 of file KisUndoView.cpp.
References d, KisUndoViewPrivate::model, and KisUndoModel::stack().
|
private |
Definition at line 102 of file KisUndoView.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. KisUndoView 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 69 of file KisUndoView.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 68 of file KisUndoView.h.