Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qdesigner_propertycommand_p.h>
Public Member Functions | |
SetPropertyCommand (QDesignerFormWindowInterface *formWindow, QUndoCommand *parent=nullptr) | |
bool | init (QObject *object, const QString &propertyName, const QVariant &newValue) |
bool | init (const QObjectList &list, const QString &propertyName, const QVariant &newValue, QObject *referenceObject=nullptr, bool enableSubPropertyHandling=true) |
QVariant | newValue () const |
void | setNewValue (const QVariant &newValue) |
int | id () const override |
Returns the ID of this command. | |
bool | mergeWith (const QUndoCommand *other) override |
Attempts to merge this command with command. | |
void | redo () override |
Applies a change to the document. | |
Public Member Functions inherited from qdesigner_internal::PropertyListCommand | |
PropertyListCommand (QDesignerFormWindowInterface *formWindow, QUndoCommand *parent=nullptr) | |
QObject * | object (int index=0) const |
QVariant | oldValue (int index=0) const |
void | setOldValue (const QVariant &oldValue, int index=0) |
void | undo () override |
Reverts a change to the document. | |
Public Member Functions inherited from qdesigner_internal::QDesignerFormWindowCommand | |
QDesignerFormWindowCommand (const QString &description, QDesignerFormWindowInterface *formWindow, QUndoCommand *parent=nullptr) | |
void | undo () override |
Reverts 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) |
int | childCount () const |
const QUndoCommand * | child (int index) const |
Additional Inherited Members | |
Static Public Member Functions inherited from qdesigner_internal::QDesignerFormWindowCommand | |
static void | updateBuddies (QDesignerFormWindowInterface *form, const QString &old_name, const QString &new_name) |
Protected Types inherited from qdesigner_internal::PropertyListCommand | |
using | PropertyHelperPtr = std::unique_ptr<PropertyHelper> |
using | PropertyHelperList = std::vector<PropertyHelperPtr> |
Definition at line 183 of file qdesigner_propertycommand_p.h.
|
explicit |
Definition at line 1182 of file qdesigner_propertycommand.cpp.
|
overridevirtual |
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 1257 of file qdesigner_propertycommand.cpp.
bool qdesigner_internal::SetPropertyCommand::init | ( | const QObjectList & | list, |
const QString & | propertyName, | ||
const QVariant & | newValue, | ||
QObject * | referenceObject = nullptr, | ||
bool | enableSubPropertyHandling = true ) |
Definition at line 1203 of file qdesigner_propertycommand.cpp.
bool qdesigner_internal::SetPropertyCommand::init | ( | QObject * | object, |
const QString & | propertyName, | ||
const QVariant & | newValue ) |
Definition at line 1189 of file qdesigner_propertycommand.cpp.
|
protectedvirtual |
Reimplemented in qdesigner_internal::ArrowKeyPropertyCommand, and qdesigner_internal::ArrowKeyPropertyCommand.
Definition at line 1262 of file qdesigner_propertycommand.cpp.
|
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.
Definition at line 1267 of file qdesigner_propertycommand.cpp.
|
inline |
Definition at line 194 of file qdesigner_propertycommand_p.h.
|
overridevirtual |
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 qdesigner_internal::QDesignerFormWindowCommand.
Definition at line 1248 of file qdesigner_propertycommand.cpp.
Definition at line 197 of file qdesigner_propertycommand_p.h.