mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-31 16:50:52 +01:00
Element editor : replace home made property by Q_PROPERTY for all primitive,
Add combo box for input to set the tagg (nothing or label, actually) Remove terminal text because unused. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3088 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
This class represents an elliptical arc primitive which may be used to
|
||||
compose the drawing of an electrical element within the element editor.
|
||||
*/
|
||||
class PartArc : public QGraphicsEllipseItem, public CustomElementGraphicPart {
|
||||
class PartArc : public CustomElementGraphicPart, public QGraphicsEllipseItem {
|
||||
Q_OBJECT
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartArc(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
@@ -53,16 +54,37 @@ class PartArc : public QGraphicsEllipseItem, public CustomElementGraphicPart {
|
||||
virtual void fromXml(const QDomElement &);
|
||||
virtual QPointF sceneTopLeft() const;
|
||||
virtual QRectF boundingRect() const;
|
||||
virtual void setAngle(int);
|
||||
virtual void setStartAngle(int);
|
||||
virtual int angle() const;
|
||||
virtual int startAngle() const;
|
||||
virtual void setProperty(const QString &, const QVariant &);
|
||||
virtual QVariant property(const QString &);
|
||||
virtual bool isUseless() const;
|
||||
virtual QRectF sceneGeometricRect() const;
|
||||
virtual void startUserTransformation(const QRectF &);
|
||||
virtual void handleUserTransformation(const QRectF &, const QRectF &);
|
||||
|
||||
///PROPERT
|
||||
// X value
|
||||
Q_PROPERTY(qreal x READ x WRITE setX)
|
||||
qreal x() const {return mapToScene(rect().center()).x() ;}
|
||||
void setX(const qreal x);
|
||||
//Y value
|
||||
Q_PROPERTY(qreal y READ y WRITE setY)
|
||||
qreal y() const {return mapToScene(rect().center()).y();}
|
||||
void setY(const qreal y);
|
||||
// horizontal diameter
|
||||
Q_PROPERTY(qreal diameter_h READ width WRITE setWidth)
|
||||
qreal width() const {return rect().width();}
|
||||
void setWidth(const qreal w);
|
||||
// vertical diameter
|
||||
Q_PROPERTY(qreal diameter_v READ height WRITE setHeight)
|
||||
qreal height() const {return rect().height();}
|
||||
void setHeight (const qreal h);
|
||||
// start angle
|
||||
Q_PROPERTY(int start_angle READ startAngle WRITE setStartAngle)
|
||||
int startAngle() const {return start_angle;}
|
||||
void setStartAngle(const int sa){start_angle = sa;}
|
||||
// angle value
|
||||
Q_PROPERTY(int angle READ angle WRITE setAngle)
|
||||
int angle() const {return _angle;}
|
||||
void setAngle(const int a) {_angle = a;}
|
||||
|
||||
|
||||
protected:
|
||||
QVariant itemChange(GraphicsItemChange, const QVariant &);
|
||||
|
||||
Reference in New Issue
Block a user