mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-13 01:22:10 +01:00
37 lines
651 B
C++
37 lines
651 B
C++
#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;}
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
QWidget *widget);
|
|
|
|
void setResolution(qreal res);
|
|
void setUnits(enum Units units);
|
|
void setDigitalZoom(qreal zoom);
|
|
|
|
private:
|
|
void updateBoundingRect();
|
|
void computeScale();
|
|
QString units() const;
|
|
|
|
qreal _res;
|
|
qreal _width;
|
|
qreal _length;
|
|
Units _units;
|
|
bool _scale;
|
|
|
|
qreal _digitalZoom;
|
|
|
|
QRectF _boundingRect;
|
|
};
|
|
|
|
#endif // SCALEITEM_H
|