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

@@ -8,12 +8,12 @@ class QetShapeItem : public QetGraphicsItem
public:
enum ShapeType {
Line,
Line = 0,
Rectangle,
Ellipse
};
QetShapeItem(QPointF, QPointF, ShapeType, bool lineAngle = false, QGraphicsItem *parent = 0);
QetShapeItem(QPointF, QPointF = QPointF(0,0), ShapeType = Line, bool lineAngle = false, QGraphicsItem *parent = 0);
virtual ~QetShapeItem();
void setStyle(Qt::PenStyle);
@@ -25,6 +25,9 @@ class QetShapeItem : public QetGraphicsItem
QLineF *getLine();
QRectF *getRectangle();
QRectF *getEllipse();
virtual bool fromXml(const QDomElement &);
virtual QDomElement toXml(QDomDocument &document) const;
void setWritingXml(bool writing) { _writingXml = writing; }
private:
ShapeType _shapeType;
@@ -35,6 +38,7 @@ class QetShapeItem : public QetGraphicsItem
bool _isFullyBuilt;
QPointF _lineP1;
QPointF _lineP2;
bool _writingXml;
virtual void editProperty() {}