1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00
GPXSee/src/GUI/axislabelitem.h
2020-11-22 14:51:57 +01:00

31 lines
579 B
C++

#ifndef AXISLABELITEM_H
#define AXISLABELITEM_H
#include <QGraphicsItem>
#include <QFont>
class AxisLabelItem : public QGraphicsItem
{
public:
enum Type {X, Y};
AxisLabelItem(Type type, QGraphicsItem *parent = 0);
QRectF boundingRect() const {return _boundingRect;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
void setLabel(const QString& label, const QString &units);
private:
void updateBoundingRect();
Type _type;
QString _label;
QFont _font;
QRect _labelBB;
QRectF _boundingRect;
};
#endif // AXISLABELITEM_H