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::ResetPropertyCommand Class Reference

#include <qdesigner_propertycommand_p.h>

+ Inheritance diagram for qdesigner_internal::ResetPropertyCommand:
+ Collaboration diagram for qdesigner_internal::ResetPropertyCommand:

Public Member Functions

 ResetPropertyCommand (QDesignerFormWindowInterface *formWindow)
 
bool init (QObject *object, const QString &propertyName)
 
bool init (const QObjectList &list, const QString &propertyName, QObject *referenceObject=nullptr)
 
void redo () override
 Applies a change to the document.
 
- Public Member Functions inherited from qdesigner_internal::PropertyListCommand
 PropertyListCommand (QDesignerFormWindowInterface *formWindow, QUndoCommand *parent=nullptr)
 
QObjectobject (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)
 
virtual int id () const
 Returns the ID of this command.
 
int childCount () const
 
const QUndoCommandchild (int index) const
 

Protected Member Functions

bool mergeWith (const QUndoCommand *) override
 Attempts to merge this command with command.
 
- Protected Member Functions inherited from qdesigner_internal::PropertyListCommand
bool add (QObject *object, const QString &propertyName)
 
bool initList (const QObjectList &list, const QString &apropertyName, QObject *referenceObject=nullptr)
 
unsigned setValue (const QVariant &value, bool changed, quint64 subPropertyMask)
 
unsigned restoreOldValue ()
 
unsigned restoreDefaultValue ()
 
void update (unsigned updateMask)
 
bool canMergeLists (const PropertyHelperList &other) const
 
PropertyHelperListpropertyHelperList ()
 
const PropertyHelperListpropertyHelperList () const
 
const QString propertyName () const
 
SpecialProperty specialProperty () const
 
const PropertyDescriptionpropertyDescription () const
 
virtual std::unique_ptr< PropertyHelpercreatePropertyHelper (QObject *o, SpecialProperty sp, QDesignerPropertySheetExtension *sheet, int sheetIndex) const
 
- Protected Member Functions inherited from qdesigner_internal::QDesignerFormWindowCommand
QDesignerFormWindowInterfaceformWindow () const
 
QDesignerFormEditorInterfacecore () const
 
QDesignerPropertySheetExtensionpropertySheet (QObject *object) const
 
void cheapUpdate ()
 
void selectUnmanagedObject (QObject *unmanagedObject)
 

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>
 

Detailed Description

Definition at line 215 of file qdesigner_propertycommand_p.h.

Constructor & Destructor Documentation

◆ ResetPropertyCommand()

qdesigner_internal::ResetPropertyCommand::ResetPropertyCommand ( QDesignerFormWindowInterface * formWindow)
explicit

Definition at line 1296 of file qdesigner_propertycommand.cpp.

Member Function Documentation

◆ init() [1/2]

bool qdesigner_internal::ResetPropertyCommand::init ( const QObjectList & list,
const QString & propertyName,
QObject * referenceObject = nullptr )

Definition at line 1313 of file qdesigner_propertycommand.cpp.

◆ init() [2/2]

bool qdesigner_internal::ResetPropertyCommand::init ( QObject * object,
const QString & propertyName )

Definition at line 1301 of file qdesigner_propertycommand.cpp.

◆ mergeWith()

bool qdesigner_internal::ResetPropertyCommand::mergeWith ( const QUndoCommand * command)
inlineoverrideprotectedvirtual

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 227 of file qdesigner_propertycommand_p.h.

◆ redo()

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

See also
undo()

Reimplemented from qdesigner_internal::QDesignerFormWindowCommand.

Definition at line 1348 of file qdesigner_propertycommand.cpp.


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