Human-friendly links
[GPXSee.git] / src / axisitem.h
blobf5a653a47883c39c873b3a5076d9c645812b3d84
1 #ifndef AXISITEM_H
2 #define AXISITEM_H
4 #include <QGraphicsItem>
5 #include "range.h"
7 class AxisItem : public QGraphicsItem
9 public:
10 enum Type {X, Y};
12 AxisItem(Type type, QGraphicsItem *parent = 0);
14 QRectF boundingRect() const {return _boundingRect;}
15 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
16 QWidget *widget);
18 void setRange(const RangeF &range);
19 void setSize(qreal size);
20 void setLabel(const QString& label);
22 QSizeF margin() const;
23 QList<qreal> ticks() const;
25 private:
26 void updateBoundingRect();
28 Type _type;
29 RangeF _range;
30 qreal _size;
31 QString _label;
32 QRectF _boundingRect;
35 #endif // AXISITEM_H