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

34 lines
595 B
C
Raw Normal View History

2016-01-14 00:37:51 +01:00
#ifndef SCALEITEM_H
#define SCALEITEM_H
#include <QGraphicsItem>
#include "units.h"
class ScaleItem : public QGraphicsItem
{
public:
ScaleItem(QGraphicsItem *parent = 0);
QRectF boundingRect() const {return _boundingRect;}
2016-01-14 00:37:51 +01:00
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
2017-01-16 09:54:12 +01:00
void setResolution(qreal res);
2016-01-14 00:37:51 +01:00
void setUnits(enum Units units);
private:
void updateBoundingRect();
2016-01-14 00:37:51 +01:00
void computeScale();
QString units() const;
2017-01-16 09:54:12 +01:00
qreal _res;
2016-01-14 00:37:51 +01:00
qreal _width;
qreal _length;
Units _units;
bool _scale;
QRectF _boundingRect;
2016-01-14 00:37:51 +01:00
};
#endif // SCALEITEM_H