Go to the documentation of this file.00001 #ifndef TRANSFERPOINT_HPP_
00002 #define TRANSFERPOINT_HPP_
00003
00004 #include <QGraphicsItem>
00005 #include <QGraphicsSceneMouseEvent>
00006
00013 class TransferPoint : public QGraphicsItem
00014 {
00015 public:
00022 TransferPoint(qreal relX, qreal relY);
00023
00028 QRectF boundingRect() const;
00029
00033 void updateScene();
00037 void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
00038
00043 void setFixed(bool fixed);
00049 void setRelativePos(qreal x, qreal y);
00054 qreal getRelativeX();
00059 qreal getRelativeY();
00064 void setColor(QColor _color);
00068 void setColorFromDialog();
00073 QColor getColor();
00074
00075 protected:
00080 void mousePressEvent(QGraphicsSceneMouseEvent *event);
00084 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
00085
00086 private:
00087 qreal relX;
00088 qreal relY;
00089 bool isFixed;
00090 QColor color;
00091
00097 void updatePosition(qreal x, qreal y);
00098 };
00099
00100 #endif