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 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 doesn't meet the requirements, no undo step is added and False is returned.
|
slot |
Clear the undo/redo stack.
|
slot |
Clear all redo steps.
|
slot |
Finish grouping started with openUndoGroup.
|
static |
Create 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 description of next redo step (or an empty string of no redo step is available)
|
slot |
Returns description of next undo step (or an empty string of no undo step is available)
|
slot |
Returns number of available redo steps.
|
slot |
Returns number of available undo steps.
|
slot |
Open an undo group; all subsequent performed steps which 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 |
Perform redo, returns false if there was no UndoStep to execute.
|
slot |
Remove all undo steps that have the given owner.
Returns True if any step was removed at all.
|
slot |
Remove UndoStep, also removes all undo operations beyond this operation; if the step belongs to an undo group, the whole group is deleted.
It is expected that users most of the time rather use removeAllUndoStepsOfOwner.
|
slot |
Set 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 |
Perform undo, returns false if there was no UndoStep to execute.
|
slot |
Get the maximum number of undo/redo steps that are retained. -1 means unlimited.