28 #include <QDomNodeList>
30 #include "../vmisc/logging.h"
31 #include "../vmisc/vabstractapplication.h"
32 #include "../vmisc/def.h"
33 #include "../vwidgets/vmaingraphicsview.h"
34 #include "../ifc/xml/vabstractpattern.h"
35 #include "../vtools/tools/vdatatool.h"
40 quint32 sourceId, quint32 destinationId, QUndoCommand *parent)
44 , m_activeDraftblockName(doc->getActiveDraftBlockName())
45 , m_sourceGroupId(sourceId)
46 , m_destinationGroupId(destinationId)
48 setText(tr(
"Move group item"));
59 qCDebug(vUndo,
"Undo move group item");
64 if (sourceGroup.isElement() && destintationGroup.isElement())
66 if (sourceGroup.appendChild(
m_source).isNull())
68 qCDebug(vUndo,
"Can't move the item.");
72 if (destintationGroup.removeChild(
m_dest).isNull())
74 qCDebug(vUndo,
"Can't move item.");
80 emit
qApp->getCurrentDocument()->patternChanged(
true);
83 if (not groups.isNull())
88 qCDebug(vUndo,
"Can't get tag Groups.");
108 qCDebug(vUndo,
"Redo move group item");
113 if (sourceGroup.isElement() && destintationGroup.isElement())
115 if (destintationGroup.appendChild(
m_dest).isNull())
117 qCDebug(vUndo,
"Can't move the item.");
121 if (sourceGroup.removeChild(
m_source).isNull())
123 qCDebug(vUndo,
"Can't move item.");
129 emit
qApp->getCurrentDocument()->patternChanged(
true);
132 if (not groups.isNull())
137 qCDebug(vUndo,
"Can't get tag Groups.");
virtual void redo() Q_DECL_OVERRIDE
virtual void undo() Q_DECL_OVERRIDE
MoveGroupItem(const QDomElement &source, const QDomElement &dest, VAbstractPattern *doc, quint32 sourceId, quint32 destinationId, QUndoCommand *parent=nullptr)
quint32 m_destinationGroupId
const QString m_activeDraftblockName
QDomElement createGroups()
void SetModified(bool modified)
static const QString TagGroup
void parseGroups(const QDomElement &domElement)
void setCurrentDraftBlock(const QString &patterPiece)
void changeActiveDraftBlock(const QString &name, const Document &parse=Document::FullParse)
changeActiveDraftBlock set new active draft block name.
QDomElement elementById(quint32 id, const QString &tagName=QString())
static void NewSceneRect(QGraphicsScene *sc, QGraphicsView *view, QGraphicsItem *item=nullptr)
NewSceneRect calculate scene rect what contains all items and doesn't less that size of scene view.