1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 13:41:16 +01:00
GPXSee/src/axisitem.h
2016-10-17 23:14:07 +02:00

36 lines
651 B
C++

#ifndef AXISITEM_H
#define AXISITEM_H
#include <QGraphicsItem>
#include "range.h"
class AxisItem : public QGraphicsItem
{
public:
enum Type {X, Y};
AxisItem(Type type, QGraphicsItem *parent = 0);
QRectF boundingRect() const {return _boundingRect;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
void setRange(const RangeF &range);
void setSize(qreal size);
void setLabel(const QString& label);
QSizeF margin() const;
QList<qreal> ticks() const;
private:
void updateBoundingRect();
Type _type;
RangeF _range;
qreal _size;
QString _label;
QRectF _boundingRect;
};
#endif // AXISITEM_H