mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Basic Shapes: XML export/import added.
Many files were changed, so debugging required. Minor Bug exists: If we export to xml first time, it is OK. But if we then add another shape and then export, then the new shape is not added in XML. Reason: UndoAction not implemented at present for basi shape addition. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2888 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -136,6 +136,43 @@ void AddImageCommand::redo() {
|
||||
imageitem -> setPos(position - imageitem -> boundingRect().center());
|
||||
}
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param dia Schema auquel on ajoute une shape
|
||||
@param shape Shape ajoute
|
||||
@param pos Position a laquelle l'shape est ajoute
|
||||
@param parent QUndoCommand parent
|
||||
*/
|
||||
AddShapeCommand::AddShapeCommand(Diagram *dia, QetShapeItem *shape, const QPointF &pos, QUndoCommand *parent):
|
||||
QUndoCommand(QObject::tr("Ajouter une Shape", "undo caption"), parent),
|
||||
shapeitem(shape),
|
||||
diagram(dia),
|
||||
position(pos)
|
||||
{
|
||||
diagram -> qgiManager().manage(shapeitem);
|
||||
}
|
||||
|
||||
///Destructor
|
||||
AddShapeCommand::~AddShapeCommand() {
|
||||
diagram -> qgiManager().release(shapeitem);
|
||||
}
|
||||
|
||||
///Annule l'ajout
|
||||
void AddShapeCommand::undo() {
|
||||
diagram -> showMe();
|
||||
diagram -> removeItem(shapeitem);
|
||||
}
|
||||
|
||||
///Refait l'ajout
|
||||
void AddShapeCommand::redo() {
|
||||
diagram -> showMe();
|
||||
if (shapeitem ->diagram() != diagram)
|
||||
diagram -> addItem(shapeitem);
|
||||
//diagram -> addDiagramImageItem(imageitem);
|
||||
//imageitem -> setPos(position - imageitem -> boundingRect().center());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param d Schema auquel on ajoute un conducteur
|
||||
|
||||
Reference in New Issue
Block a user