|  | HAL
    | 
Create a new item. More...
#include <action_create_object.h>


| Public Member Functions | |
| ActionCreateObject (UserActionObjectType::ObjectType type=UserActionObjectType::None, const QString &objName=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 | 
| void | setParentId (u32 pid) | 
| void | setLinkedObjectId (u32 lid) | 
|  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 | 
| UserAction * | undoAction () 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< u32 > | setFromText (const QString &s) | 
| static QString | gridToText (const QHash< hal::Node, QPoint > &grid) | 
| static QHash< hal::Node, QPoint > | gridFromText (const QString &txt) | 
|  Protected Attributes inherited from hal::UserAction | |
| UserActionObject | mObject | 
| UserActionObject | mParentObject | 
| int | mCompoundOrder | 
| UserAction * | mUndoAction | 
| qint64 | mTimeStamp | 
| bool | mObjectLock | 
| bool | mParentObjectLock | 
| bool | mProjectModified | 
Create a new item.
Creates a new object with a given type and name.
Undo Action: ActionDeleteObject.
Definition at line 39 of file action_create_object.h.
| hal::ActionCreateObject::ActionCreateObject | ( | UserActionObjectType::ObjectType | type = UserActionObjectType::None, | 
| const QString & | objName = QString() | ||
| ) | 
Action Constructor.
| type | - The UserActionObjectType of the item that should be created (default type: None) | 
| objName | - The name of the object to create (default name: ""). | 
Definition at line 26 of file action_create_object.cpp.
References hal::UserAction::setObject(), and type.
| 
 | overridevirtual | 
Hook for derived classes to add parameter to cryptographic hash.
| cryptoHash | - Additional hash data. | 
Reimplemented from hal::UserAction.
Definition at line 33 of file action_create_object.cpp.
References QCryptographicHash::addData(), and QString::toUtf8().
| 
 | 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.
Reimplemented from hal::UserAction.
Definition at line 60 of file action_create_object.cpp.
References hal::GroupingTableModel::addDefaultEntry(), hal::UserActionObjectType::ContextDir, hal::UserActionObjectType::ContextView, hal::Netlist::create_module(), hal::Netlist::create_net(), hal::GraphContextManager::createNewContext(), hal::GraphContextManager::createNewDirectory(), hal::UserAction::exec(), hal::gContentManager, hal::Grouping::get_id(), hal::Module::get_id(), hal::Netlist::get_module_by_id(), hal::Netlist::get_unique_module_id(), hal::ContentManager::getGroupingManagerWidget(), hal::GroupingManagerWidget::getModel(), hal::gGraphContextManager, hal::gNetlist, hal::UserActionObjectType::Grouping, hal::ContextDirectory::id(), hal::GraphContext::id(), hal::UserActionObject::id(), QString::isEmpty(), log_warning, hal::UserAction::mObject, hal::UserActionObjectType::Module, hal::UserAction::mUndoAction, test::n, hal::UserActionObjectType::Net, hal::GraphContextManager::nextDefaultName(), hal::GroupingTableModel::renameGrouping(), hal::GraphContextManager::setContextId(), hal::GraphContext::setExclusiveModuleId(), hal::ContextDirectory::setId(), hal::UserAction::setObject(), QString::toStdString(), and hal::UserActionObject::type().
Referenced by hal::NetlistRelay::addChildModuleDialog().
| 
 | overridevirtual | 
Reads user interaction as well as arguments from xml macro file.
| xmlIn | - The xml reader. | 
Reimplemented from hal::UserAction.
Definition at line 47 of file action_create_object.cpp.
References QXmlStreamReader::name(), QXmlStreamReader::readElementText(), QXmlStreamReader::readNextStartElement(), and QString::toInt().
| 
 | inline | 
Definition at line 60 of file action_create_object.h.
Referenced by hal::ActionDeleteObject::exec().
| 
 | inline | 
Definition at line 59 of file action_create_object.h.
Referenced by hal::NetlistRelay::addChildModuleDialog(), hal::NetlistRelay::addToModuleDialog(), and hal::ActionDeleteObject::exec().
| 
 | overridevirtual | 
The xml tagname for the action is purely virtual and needs to be implemented in derived class.
Implements hal::UserAction.
Definition at line 21 of file action_create_object.cpp.
References hal::ActionCreateObjectFactory::sFactory, and hal::UserActionFactory::tagname().
| 
 | overridevirtual | 
Persist user interaction in xml macro file.
| xmlOut | - The xml writer. | 
Reimplemented from hal::UserAction.
Definition at line 40 of file action_create_object.cpp.
References QString::number(), and QXmlStreamWriter::writeTextElement().