MeVisLab Scripting Reference
|
Inherits MLRefCountedBaseWrapper.
Public Slots | |
bool | addUndoStep (PythonQtObjectPtr step) |
void | clear () |
void | clearRedoSteps () |
void | closeUndoGroup () |
bool | duringRedo () |
bool | duringUndo () |
bool | duringUndoOrRedo () |
QStringList | getAllRedoDescriptions () const |
QStringList | getAllUndoDescriptions () const |
QString | getRedoDescription () const |
QString | getUndoDescription () const |
int | numRedoSteps () const |
int | numUndoSteps () const |
void | openUndoGroup (const QString &description) |
bool | redo () |
bool | removeAllUndoStepsOfOwner (PythonQtObjectPtr owner) |
void | removeUndoStep (PythonQtObjectPtr step) |
void | setUndoLimit (int limit) |
bool | undo () |
int | undoLimit () const |
Signals | |
void | stateChanged () |
Static Public Member Functions | |
static ml::RefCountedBase * | createObject (const QVariantList &arguments) |
A class that wraps UndoContext objects for use in Python.
|
slot |
Add Python object as an undo step.
This object needs to have the following properties:
undo - Must be a callable that performs the undo step.
redo - Must be a callable that performs the redo step.
description - Must be a callable that returns the description or else the description itself; if the description is not a string, repr() is called on the value.
owner (optional) - The object that should be considered as the owner of this undo step. This can be used to remove all undo steps of that owner at once with removeAllUndoStepsOfOwner.
dispose (optional) - A callable that is called when the undo step is removed from the undo context.
If the given object does not meet the requirements, no undo step is added and False is returned.
|
slot |
Clears the undo/redo stack.
|
slot |
Clears all redo steps.
|
slot |
Finishes grouping started with openUndoGroup.
|
static |
Creates a new UndoContext. No arguments need to be provided.
|
slot |
Returns true
while an redo operation is performed.
|
slot |
Returns true
while an undo operation is performed.
|
slot |
Returns true
while an undo or redo operation is performed.
|
slot |
Returns the description of the all available redo steps, with the next redo step first.
|
slot |
Returns the description of the all available undo steps, with the next undo step first.
|
slot |
Returns a description of the next redo step (or an empty string of no redo step is available).
|
slot |
Returns a description of the next undo step (or an empty string of no undo step is available).
|
slot |
Returns the number of available redo steps.
|
slot |
Returns the number of available undo steps.
|
slot |
Opens an undo group; all subsequent performed steps that generate an undo step will grouped and appear under the given description.
closeUndoGroup must be called to finish the grouping. Nesting of calls is allowed.
|
slot |
Performs redo, returns false
if there was no UndoStep to execute.
|
slot |
Removes all undo steps that have the given owner.
Returns True if any step was removed at all.
|
slot |
Removes UndoStep, also removes all undo operations beyond this operation; if the step belongs to an undo group, the entire group is deleted.
It is expected that users most of the time rather use removeAllUndoStepsOfOwner.
|
slot |
Sets the maximum number of undo/redo steps to retain.
-1 means unlimited. Setting this will remove excess steps (undo steps first).
|
signal |
Emitted if the state of the UndoContext changes (undo/redo steps have been added or removed).
|
slot |
Performs undo, returns false
if there was no UndoStep to execute.
|
slot |
Returns the maximum number of undo/redo steps that are retained. -1 means unlimited.