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:
abhishekm71
2014-02-28 14:30:59 +00:00
parent dce76e46c9
commit 092c638868
11 changed files with 195 additions and 31 deletions

View File

@@ -461,6 +461,9 @@ void DiagramView::mousePressEvent(QMouseEvent *e) {
rubber_band_origin = mapToScene(e -> pos());
newItem = new QetShapeItem(rubber_band_origin, rubber_band_origin, QetShapeItem::Line, false);
scene -> addItem(newItem);
// le place a la position pos en gerant l'annulation
//scene -> undoStack().push(new AddShapeCommand(scene, newItem, e->pos));
//adjustSceneRect();
break;
case addingRectangle:
rubber_band_origin = mapToScene(e -> pos());
@@ -714,7 +717,7 @@ bool DiagramView::hasCopiableItems() {
if (
qgraphicsitem_cast<Element *>(qgi) ||
qgraphicsitem_cast<IndependentTextItem *>(qgi) ||
qgraphicsitem_cast<QetShapeItem *>(qgi) ||
dynamic_cast<QetShapeItem *>(qgi) ||
qgraphicsitem_cast<DiagramImageItem *>(qgi)
) {
return(true);
@@ -733,7 +736,7 @@ bool DiagramView::hasDeletableItems() {
qgraphicsitem_cast<Element *>(qgi) ||
qgraphicsitem_cast<Conductor *>(qgi) ||
qgraphicsitem_cast<IndependentTextItem *>(qgi) ||
qgraphicsitem_cast<QetShapeItem *>(qgi) ||
dynamic_cast<QetShapeItem *>(qgi) ||
qgraphicsitem_cast<DiagramImageItem *>(qgi)
) {
return(true);