1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutundostack.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayoutUndoStack : QObject
{
%Docstring(signature="appended")
An undo stack for :py:class:`QgsLayouts`.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutundostack.h"
%End
public:
QgsLayoutUndoStack( QgsLayout *layout );
%Docstring
Constructor for QgsLayoutUndoStack, for the specified parent ``layout``.
%End
void beginMacro( const QString &commandText );
%Docstring
Starts a macro command, with the given descriptive ``commandText``.
Any commands added to the stack (either via direct manipulation of
:py:func:`~QgsLayoutUndoStack.stack` or via :py:func:`~QgsLayoutUndoStack.beginCommand`/:py:func:`~QgsLayoutUndoStack.endCommand` calls) between a
:py:func:`~QgsLayoutUndoStack.beginMacro` and :py:func:`~QgsLayoutUndoStack.endMacro` block are collapsed into a single
undo command, which will be applied or rolled back in a single step.
.. seealso:: :py:func:`endMacro`
%End
void endMacro();
%Docstring
Ends a macro command. This must be called after :py:func:`~QgsLayoutUndoStack.beginMacro`, when
all child undo commands which form part of the macro have been completed.
Any commands added to the stack (either via direct manipulation of
:py:func:`~QgsLayoutUndoStack.stack` or via :py:func:`~QgsLayoutUndoStack.beginCommand`/:py:func:`~QgsLayoutUndoStack.endCommand` calls) between a
:py:func:`~QgsLayoutUndoStack.beginMacro` and :py:func:`~QgsLayoutUndoStack.endMacro` block are collapsed into a single
undo command, which will be applied or rolled back in a single step.
.. seealso:: :py:func:`beginMacro`
%End
void beginCommand( QgsLayoutUndoObjectInterface *object, const QString &commandText, int id = 0 );
%Docstring
Begins a new undo command for the specified ``object``.
This must be followed by a call to :py:func:`~QgsLayoutUndoStack.endCommand` or :py:func:`~QgsLayoutUndoStack.cancelCommand` after the desired changes
have been made to ``object``.
The ``id`` argument can be used to specify an id number for the source event - this is used to determine whether QUndoCommand
command compression can apply to the command.
.. seealso:: :py:func:`endCommand`
.. seealso:: :py:func:`cancelCommand`
%End
void endCommand();
%Docstring
Saves final state of an object and pushes the active command to the undo history.
.. seealso:: :py:func:`beginCommand`
.. seealso:: :py:func:`cancelCommand`
%End
void cancelCommand();
%Docstring
Cancels the active command, discarding it without pushing to the undo history.
.. seealso:: :py:func:`endCommand`
.. seealso:: :py:func:`cancelCommand`
%End
QUndoStack *stack();
%Docstring
Returns a pointer to the internal QUndoStack.
%End
void notifyUndoRedoOccurred( QgsLayoutItem *item );
%Docstring
Notifies the stack that an undo or redo action occurred for a specified ``item``.
%End
void blockCommands( bool blocked );
%Docstring
Sets whether undo commands for the layout should be temporarily blocked.
If ``blocked`` is ``True``, subsequent undo commands will be blocked until a follow-up
call to blockCommands( ``False`` ) is made.
Note that calls to blockCommands are stacked, so two calls blocking the commands
will take two calls unblocking commands in order to release the block.
.. seealso:: :py:func:`isBlocked`
%End
bool isBlocked() const;
%Docstring
Returns ``True`` if undo commands are currently blocked.
.. seealso:: :py:func:`blockCommands`
%End
void push( QUndoCommand *command /Transfer/ );
%Docstring
Manually pushes a ``command`` to the stack, and takes ownership of the command.
%End
signals:
void undoRedoOccurredForItems( QSet< QString > itemUuids );
%Docstring
Emitted when an undo or redo action has occurred, which affected a
set of layout ``itemUuids``.
%End
private:
QgsLayoutUndoStack( const QgsLayoutUndoStack &other );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutundostack.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
|