HAL
hal::ActionRenameObject Class Reference

Renames an item. More...

#include <action_rename_object.h>

Inheritance diagram for hal::ActionRenameObject:
Inheritance graph
Collaboration diagram for hal::ActionRenameObject:
Collaboration graph

Public Member Functions

 ActionRenameObject (const QString &name=QString())
 
bool exec () override
 
QString tagname () const override
 
void writeToXml (QXmlStreamWriter &xmlOut) const override
 
void readFromXml (QXmlStreamReader &xmlIn) override
 
void addToHash (QCryptographicHash &cryptoHash) const override
 
- Public Member Functions inherited from hal::UserAction
virtual ~UserAction ()
 
virtual UserActionObject object () const
 
virtual void setObject (const UserActionObject &obj)
 
int compoundOrder () const
 
void setCompoundOrder (int cmpord)
 
qint64 timeStamp () const
 
QString cryptographicHash (int recordNo) const
 
UserActionundoAction () const
 
QString debugDump () const
 
void setObjectLock (bool lock)
 
void setParentObjectLock (bool lock)
 
bool hasProjectModified () const
 

Additional Inherited Members

- Protected Member Functions inherited from hal::UserAction
 UserAction ()
 
void writeParentObjectToXml (QXmlStreamWriter &xmlOut) const
 
void readParentObjectFromXml (QXmlStreamReader &xmlIn)
 
- Static Protected Member Functions inherited from hal::UserAction
static QString setToText (const QSet< u32 > &set)
 
static QSet< u32setFromText (const QString &s)
 
static QString gridToText (const QHash< hal::Node, QPoint > &grid)
 
static QHash< hal::Node, QPointgridFromText (const QString &txt)
 
- Protected Attributes inherited from hal::UserAction
UserActionObject mObject
 
UserActionObject mParentObject
 
int mCompoundOrder
 
UserActionmUndoAction
 
qint64 mTimeStamp
 
bool mObjectLock
 
bool mParentObjectLock
 
bool mProjectModified
 

Detailed Description

Renames an item.

Assigns a new name to the UserActionObject's object. If the object is a pin or pingroup type the current name is used to identify the pin or group (configured by setPinOrPingroupIdentifier)

Undo Action: ActionRenameObject

Definition at line 41 of file action_rename_object.h.

Constructor & Destructor Documentation

◆ ActionRenameObject()

hal::ActionRenameObject::ActionRenameObject ( const QString name = QString())
inline

Action constructor.

Parameters
name- The new name

Definition at line 51 of file action_rename_object.h.

Referenced by exec().

Member Function Documentation

◆ addToHash()

void hal::ActionRenameObject::addToHash ( QCryptographicHash cryptoHash) const
overridevirtual

Hook for derived classes to add parameter to cryptographic hash.

Parameters
cryptoHash- Additional hash data.

Reimplemented from hal::UserAction.

Definition at line 29 of file action_rename_object.cpp.

References QCryptographicHash::addData(), and QString::toUtf8().

◆ exec()

bool hal::ActionRenameObject::exec ( )
overridevirtual

Executes user interaction and returns true on success. Note: Each implementation of exec() must include a call to the exec() method of base class to store the UserAction object in history and to transfer its ownership.

Returns
True on success, False otherwise.

Reimplemented from hal::UserAction.

Definition at line 48 of file action_rename_object.cpp.

References ActionRenameObject(), hal::UserActionObjectType::ContextDir, hal::UserActionObjectType::ContextView, hal::UserAction::exec(), QString::fromStdString(), hal::UserActionObjectType::Gate, hal::gContentManager, hal::Netlist::get_gate_by_id(), hal::Netlist::get_module_by_id(), hal::Gate::get_name(), hal::Module::get_name(), hal::Netlist::get_net_by_id(), hal::GraphContextManager::getContextById(), hal::GraphContextManager::getDirectoryById(), hal::ContentManager::getGroupingManagerWidget(), hal::GroupingManagerWidget::getModel(), hal::gGraphContextManager, hal::gNetlist, hal::UserActionObjectType::Grouping, hal::UserActionObject::id(), hal::UserAction::mObject, hal::UserActionObjectType::Module, hal::UserAction::mUndoAction, hal::ContextDirectory::name(), hal::GraphContext::name(), hal::UserActionObjectType::Net, net, hal::GraphContextManager::renameContextDirectoryAction(), hal::GraphContextManager::renameGraphContextAction(), hal::GroupingTableModel::renameGrouping(), hal::Gate::set_name(), hal::Module::set_name(), hal::UserAction::setObject(), QString::toStdString(), and hal::UserActionObject::type().

Referenced by hal::NetlistRelay::changeElementNameDialog().

◆ readFromXml()

void hal::ActionRenameObject::readFromXml ( QXmlStreamReader xmlIn)
overridevirtual

Reads user interaction as well as arguments from xml macro file.

Parameters
xmlIn- The xml reader.

Reimplemented from hal::UserAction.

Definition at line 39 of file action_rename_object.cpp.

References QXmlStreamReader::name(), QXmlStreamReader::readElementText(), and QXmlStreamReader::readNextStartElement().

◆ tagname()

QString hal::ActionRenameObject::tagname ( ) const
overridevirtual

The xml tagname for the action is purely virtual and needs to be implemented in derived class.

Returns
The tagname.

Implements hal::UserAction.

Definition at line 24 of file action_rename_object.cpp.

References hal::ActionRenameObjectFactory::sFactory, and hal::UserActionFactory::tagname().

◆ writeToXml()

void hal::ActionRenameObject::writeToXml ( QXmlStreamWriter xmlOut) const
overridevirtual

Persist user interaction in xml macro file.

Parameters
xmlOut- The xml writer.

Reimplemented from hal::UserAction.

Definition at line 34 of file action_rename_object.cpp.

References QXmlStreamWriter::writeTextElement().


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