Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdesigner_internal::CECommand Class Reference

#include <connectionedit_p.h>

+ Inheritance diagram for qdesigner_internal::CECommand:
+ Collaboration diagram for qdesigner_internal::CECommand:

Public Member Functions

 CECommand (ConnectionEdit *edit)
 
bool mergeWith (const QUndoCommand *) override
 Attempts to merge this command with command.
 
ConnectionEditedit () const
 
- 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.
 
virtual void undo ()
 Reverts a change to the document.
 
virtual void redo ()
 Applies a change to the document.
 
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 QUndoCommandchild (int index) const
 

Additional Inherited Members

- Public Types inherited from qdesigner_internal::CETypes
enum  LineDir { UpDir = 0 , DownDir , RightDir , LeftDir }
 
using ConnectionList = QList<Connection *>
 
using ConnectionSet = QHash<Connection*, Connection*>
 
using WidgetSet = QHash<QWidget*, QWidget*>
 

Detailed Description

Definition at line 247 of file connectionedit_p.h.

Constructor & Destructor Documentation

◆ CECommand()

qdesigner_internal::CECommand::CECommand ( ConnectionEdit * edit)
inlineexplicit

Definition at line 250 of file connectionedit_p.h.

Member Function Documentation

◆ edit()

ConnectionEdit * qdesigner_internal::CECommand::edit ( ) const
inline

Definition at line 255 of file connectionedit_p.h.

◆ mergeWith()

bool qdesigner_internal::CECommand::mergeWith ( const QUndoCommand * command)
inlineoverridevirtual

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.

{
if (other->id() != id()) // make sure other is also an AppendText command
return false;
m_text += static_cast<const AppendText*>(other)->m_text;
return true;
}
See also
id(), QUndoStack::push()

Reimplemented from QUndoCommand.

Definition at line 253 of file connectionedit_p.h.


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