1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/GUI/axisitem.h

36 lines
658 B
C
Raw Normal View History

2015-10-05 01:43:48 +02:00
#ifndef AXISITEM_H
#define AXISITEM_H
#include <QGraphicsItem>
2017-11-26 18:54:03 +01:00
#include "common/range.h"
2015-10-05 01:43:48 +02:00
class AxisItem : public QGraphicsItem
{
public:
enum Type {X, Y};
2015-10-17 01:33:02 +02:00
AxisItem(Type type, QGraphicsItem *parent = 0);
2015-10-05 01:43:48 +02:00
QRectF boundingRect() const {return _boundingRect;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
2016-03-27 13:23:00 +02:00
void setRange(const RangeF &range);
2015-10-05 01:43:48 +02:00
void setSize(qreal size);
void setLabel(const QString& label);
2016-03-19 17:24:53 +01:00
QSizeF margin() const;
2016-10-17 23:14:07 +02:00
QList<qreal> ticks() const;
2015-10-05 01:43:48 +02:00
private:
void updateBoundingRect();
Type _type;
2016-03-27 13:23:00 +02:00
RangeF _range;
2015-10-05 01:43:48 +02:00
qreal _size;
QString _label;
QRectF _boundingRect;
};
#endif // AXISITEM_H