![]() |
QElectroTech 0.200.1-dev
|
The PromoteShapeCommand class Used whenever a shape's identity changes – a Rectangle's corner is dragged independently and it becomes a Polygon, an Arc is explicitly converted to a free-form Path, etc. More...
#include <promoteshapecommand.h>
Inherits QUndoCommand.

Public Member Functions | |
| PromoteShapeCommand (QetShapeItem *shape, const QDomElement &priorStateXml, const QDomElement &newStateXml, QUndoCommand *parent=nullptr) | |
| void | undo () override |
| void | redo () override |
Private Attributes | |
| QPointer< QetShapeItem > | m_shape |
| QDomDocument | m_priorDoc |
| QDomDocument | m_newDoc |
The PromoteShapeCommand class Used whenever a shape's identity changes – a Rectangle's corner is dragged independently and it becomes a Polygon, an Arc is explicitly converted to a free-form Path, etc.
The saved .qet file never records what a shape used to be; that fact only needs to survive as long as the rest of the edit history does, so it lives entirely here, as a full XML snapshot on each side. Undo restores the exact prior shape – type, geometry and transform alike – by round-tripping through the same fromXml() every other load uses. Once the file is saved and reopened, the promotion is permanent, same as any other undo history.
| PromoteShapeCommand::PromoteShapeCommand | ( | QetShapeItem * | shape, |
| const QDomElement & | priorStateXml, | ||
| const QDomElement & | newStateXml, | ||
| QUndoCommand * | parent = nullptr ) |
|
override |
|
override |
|
private |
|
private |
|
private |