mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-01 02:29:58 +02: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:
@@ -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() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user