![]() |
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 | |
AppendText (QString *doc, const QString &text) | |
void | undo () override |
Reverts a change to the document. | |
void | redo () override |
Applies a change to the document. | |
bool | mergeWith (const QUndoCommand *other) override |
[3] | |
AppendText (QString *doc, const QString &text) | |
void | undo () override |
Reverts a change to the document. | |
void | redo () override |
Applies a change to the document. | |
bool | mergeWith (const QUndoCommand *other) override |
Attempts to merge this command with 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 int | id () const |
Returns the ID of this command. | |
int | childCount () const |
const QUndoCommand * | child (int index) const |
[0]
Definition at line 7 of file src_gui_util_qundostack.cpp.
Definition at line 10 of file src_gui_util_qundostack.cpp.
References AppendText().
Referenced by AppendText().
Definition at line 10 of file src_gui_util_qundostack.cpp.
|
overridevirtual |
|
overridevirtual |
Attempts to merge this command with command.
Returns true
on success; otherwise returns false
.
If this function returns true
, calling this command's redo() must have the same effect as redoing both this command and command. Similarly, calling this command's undo() must have the same effect as undoing command and this command.
QUndoStack will only try to merge two commands if they have the same id, and the id is not -1.
The default implementation returns false
.
Reimplemented from QUndoCommand.
|
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 14 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 14 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 12 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 12 of file src_gui_util_qundostack.cpp.