Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
AppendText Class Reference

[0] More...

+ Inheritance diagram for AppendText:
+ Collaboration diagram for AppendText:

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.
 
- 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.
 
virtual bool mergeWith (const QUndoCommand *other)
 Attempts to merge this command with command.
 
int childCount () const
 
const QUndoCommandchild (int index) const
 

Detailed Description

[0]

Definition at line 5 of file src_gui_util_qundostack.cpp.

Constructor & Destructor Documentation

◆ AppendText()

AppendText::AppendText ( QString * doc,
const QString & text )
inline

Definition at line 8 of file src_gui_util_qundostack.cpp.

References QUndoCommand::setText().

+ Here is the call graph for this function:

Member Function Documentation

◆ redo()

void AppendText::redo ( )
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.

See also
undo()

Reimplemented from QUndoCommand.

Definition at line 12 of file src_gui_util_qundostack.cpp.

References QString::append().

+ Here is the call graph for this function:

◆ undo()

void AppendText::undo ( )
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.

See also
redo()

Reimplemented from QUndoCommand.

Definition at line 10 of file src_gui_util_qundostack.cpp.

References QString::chop(), and QString::length().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: