mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
31 lines
579 B
C++
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
|