diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-02-27 13:28:58 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-27 10:48:47 -0800 |
commit | 52fe9101c8c69fee522385abf5d5e1037f60e59c (patch) | |
tree | f38730c8129872097cd7a032a19a0e7896fe2c37 /qt-ui/profile/ruleritem.h | |
parent | 169589413056c8c76f52de5db662fe2269ff8c65 (diff) | |
download | subsurface-52fe9101c8c69fee522385abf5d5e1037f60e59c.tar.gz |
New profile: add placeholder code for the RulerItem
This patch just creates two files for the rulerItem, a .h and a .cpp.
nothing was done to make it visible on the new profile yet - will do that
on the next commits
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/ruleritem.h')
-rw-r--r-- | qt-ui/profile/ruleritem.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/qt-ui/profile/ruleritem.h b/qt-ui/profile/ruleritem.h new file mode 100644 index 000000000..68d6c3180 --- /dev/null +++ b/qt-ui/profile/ruleritem.h @@ -0,0 +1,50 @@ +#ifndef RULERITEM_H +#define RULERITEM_H + +#include <QObject> +#include <QGraphicsEllipseItem> +#include <QGraphicsObject> + +struct plot_data; +class RulerItem2; + +class RulerNodeItem2 : public QObject, public QGraphicsEllipseItem +{ + Q_OBJECT + friend class RulerItem2; +public: + explicit RulerNodeItem2(QGraphicsItem* parent); + void setRuler(RulerItem2 *r); + void recalculate(); + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant & value ); + +private: + struct plot_data *entry; + RulerItem2* ruler; +}; + +class RulerItem2 : public QGraphicsObject +{ + Q_OBJECT +public: + explicit RulerItem2(QGraphicsItem* parent, + RulerNodeItem2 *sourceMarker, + RulerNodeItem2 *destMarker); + void recalculate(); + + RulerNodeItem2* sourceNode() const; + RulerNodeItem2* destNode() const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget * widget = 0); + QRectF boundingRect() const; + QPainterPath shape() const; + +private: + QPointF startPoint, endPoint; + RulerNodeItem2 *source, *dest; + QString text; + int height; + int paint_direction; +}; +#endif
\ No newline at end of file |