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

50 lines
1.0 KiB
C
Raw Normal View History

2016-08-09 01:16:19 +02:00
#ifndef ROUTEITEM_H
#define ROUTEITEM_H
#include <QGraphicsItem>
#include "markeritem.h"
#include "route.h"
#include "units.h"
2016-08-09 01:16:19 +02:00
class RouteItem : public QGraphicsItem
{
public:
RouteItem(const Route &route, QGraphicsItem *parent = 0);
QPainterPath shape() const {return _shape;}
QRectF boundingRect() const {return _shape.boundingRect();}
2016-08-09 01:16:19 +02:00
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
const QPainterPath &path() const {return _path;}
void setScale(qreal scale);
void setColor(const QColor &color);
void setUnits(enum Units units);
2016-08-09 01:16:19 +02:00
void showMarker(bool show) {_marker->setVisible(show);}
void moveMarker(qreal distance);
2016-08-09 01:16:19 +02:00
2016-08-09 10:47:49 +02:00
void showWaypoints(bool show);
void showWaypointLabels(bool show);
2016-08-09 10:47:49 +02:00
2016-08-09 01:16:19 +02:00
private:
2016-09-10 13:11:46 +02:00
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void updateShape();
QString toolTip();
2016-08-09 01:16:19 +02:00
QPainterPath _path;
QPainterPath _shape;
2016-08-09 01:16:19 +02:00
QPen _pen;
MarkerItem *_marker;
Units _units;
qreal _distance;
2016-08-09 01:16:19 +02:00
};
#endif // ROUTEITEM_H