![]() |
HAL
|
Moves a node. More...
#include <action_move_item.h>
Public Member Functions | |
ActionMoveItem (u32 tgtId=0, u32 srcId=0, int tgtRow=-1) | |
bool | exec () override |
QString | tagname () const override |
void | writeToXml (QXmlStreamWriter &xmlOut) const override |
void | readFromXml (QXmlStreamReader &xmlIn) override |
void | addToHash (QCryptographicHash &cryptoHash) const override |
![]() | |
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 | |
![]() | |
UserAction () | |
void | writeParentObjectToXml (QXmlStreamWriter &xmlOut) const |
void | readParentObjectFromXml (QXmlStreamReader &xmlIn) |
![]() | |
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) |
![]() | |
UserActionObject | mObject |
UserActionObject | mParentObject |
int | mCompoundOrder |
UserAction * | mUndoAction |
qint64 | mTimeStamp |
bool | mObjectLock |
bool | mParentObjectLock |
bool | mProjectModified |
Moves a node.
Moves a node to another grid position in the GraphicsScene. The Context ID should be provided by passing it in the UserActionObject of type UserActionObjectType::Context.
Undo Action: ActionMoveItem
Definition at line 42 of file action_move_item.h.
Action constructor.
Will move the tree item to new parent, action object must indicate tree item
Definition at line 23 of file action_move_item.cpp.
Referenced by exec().
|
overridevirtual |
Hook for derived classes to add parameter to cryptographic hash.
cryptoHash | - Additional hash data. |
Reimplemented from hal::UserAction.
Definition at line 32 of file action_move_item.cpp.
References QCryptographicHash::addData().
|
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 55 of file action_move_item.cpp.
References ActionMoveItem(), hal::UserActionObjectType::ContextDir, hal::UserActionObjectType::ContextView, hal::UserAction::exec(), hal::ContextTreeModel::getContext(), hal::GraphContextManager::getContextTreeModel(), hal::ContextTreeModel::getDirectory(), hal::ContextTreeItem::getId(), hal::BaseTreeModel::getIndexFromItem(), hal::BaseTreeItem::getParent(), hal::gGraphContextManager, hal::UserActionObject::id(), QModelIndex::isValid(), hal::UserAction::mObject, hal::GraphContextManager::moveItem(), hal::UserAction::mUndoAction, QModelIndex::row(), hal::UserAction::setObject(), and hal::UserActionObject::type().
Referenced by hal::ContextProxyModel::dropMimeData(), hal::GuiApiClasses::View::moveDirectory(), and hal::GuiApiClasses::View::moveView().
|
overridevirtual |
Reads user interaction as well as arguments from xml macro file.
xmlIn | - The xml reader. |
Reimplemented from hal::UserAction.
Definition at line 44 of file action_move_item.cpp.
References QXmlStreamReader::name(), QXmlStreamReader::readElementText(), QXmlStreamReader::readNextStartElement(), and QString::toUInt().
|
overridevirtual |
The xml tagname for the action is purely virtual and needs to be implemented in derived class.
Implements hal::UserAction.
Definition at line 27 of file action_move_item.cpp.
References hal::ActionMoveItemFactory::sFactory, and hal::UserActionFactory::tagname().
|
overridevirtual |
Persist user interaction in xml macro file.
xmlOut | - The xml writer. |
Reimplemented from hal::UserAction.
Definition at line 37 of file action_move_item.cpp.
References QXmlStreamWriter::writeTextElement().