![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
[0] More...
Public Member Functions | |
MyCommand () | |
void | undo () override |
Reverts a change to the document. | |
void | redo () override |
Applies a change to the document. | |
int | id () const override |
Returns the ID of this command. | |
MyCommand () | |
void | undo () override |
Reverts a change to the document. | |
void | redo () override |
Applies a change to the document. | |
int | id () const override |
Returns the ID of this command. | |
Public Member Functions inherited from QUndoCommand | |
QUndoCommand (QUndoCommand *parent=nullptr) | |
Constructs a QUndoCommand object with parent parent. | |
QUndoCommand (const QString &text, QUndoCommand *parent=nullptr) | |
Constructs a QUndoCommand object with the given parent and text. | |
virtual | ~QUndoCommand () |
Destroys the QUndoCommand object and all child commands. | |
QString | text () const |
Returns a short text string describing what this command does; for example, "insert text". | |
QString | actionText () const |
void | setText (const QString &text) |
Sets the command's text to be the text specified. | |
bool | isObsolete () const |
void | setObsolete (bool obsolete) |
virtual bool | mergeWith (const QUndoCommand *other) |
Attempts to merge this command with command. | |
int | childCount () const |
const QUndoCommand * | child (int index) const |
[0]
Definition at line 23 of file src_gui_util_qundostack.cpp.
|
inline |
Definition at line 25 of file src_gui_util_qundostack.cpp.
Referenced by examples().
|
inline |
Definition at line 25 of file src_gui_util_qundostack.cpp.
|
inlineoverridevirtual |
Returns the ID of this command.
A command ID is used in command compression. It must be an integer unique to this command's class, or -1 if the command doesn't support compression.
If the command supports compression this function must be overridden in the derived class to return the correct ID. The base implementation returns -1.
QUndoStack::push() will only try to merge two commands if they have the same ID, and the ID is not -1.
Reimplemented from QUndoCommand.
Definition at line 28 of file src_gui_util_qundostack.cpp.
|
inlineoverridevirtual |
Returns the ID of this command.
A command ID is used in command compression. It must be an integer unique to this command's class, or -1 if the command doesn't support compression.
If the command supports compression this function must be overridden in the derived class to return the correct ID. The base implementation returns -1.
QUndoStack::push() will only try to merge two commands if they have the same ID, and the ID is not -1.
Reimplemented from QUndoCommand.
Definition at line 28 of file src_gui_util_qundostack.cpp.
|
inlineoverridevirtual |
Applies a change to the document.
This function must be implemented in the derived class. Calling QUndoStack::push(), QUndoStack::undo() or QUndoStack::redo() from this function leads to undefined beahavior.
The default implementation calls redo() on all child commands.
Reimplemented from QUndoCommand.
Definition at line 27 of file src_gui_util_qundostack.cpp.
|
inlineoverridevirtual |
Applies a change to the document.
This function must be implemented in the derived class. Calling QUndoStack::push(), QUndoStack::undo() or QUndoStack::redo() from this function leads to undefined beahavior.
The default implementation calls redo() on all child commands.
Reimplemented from QUndoCommand.
Definition at line 27 of file src_gui_util_qundostack.cpp.
|
inlineoverridevirtual |
Reverts a change to the document.
After undo() is called, the state of the document should be the same as before redo() was called. This function must be implemented in the derived class. Calling QUndoStack::push(), QUndoStack::undo() or QUndoStack::redo() from this function leads to undefined beahavior.
The default implementation calls undo() on all child commands in reverse order.
Reimplemented from QUndoCommand.
Definition at line 26 of file src_gui_util_qundostack.cpp.
|
inlineoverridevirtual |
Reverts a change to the document.
After undo() is called, the state of the document should be the same as before redo() was called. This function must be implemented in the derived class. Calling QUndoStack::push(), QUndoStack::undo() or QUndoStack::redo() from this function leads to undefined beahavior.
The default implementation calls undo() on all child commands in reverse order.
Reimplemented from QUndoCommand.
Definition at line 26 of file src_gui_util_qundostack.cpp.