1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 13:41:16 +01:00

Added missing area-under-mouse highlighting

This commit is contained in:
Martin Tůma 2019-08-19 19:22:16 +02:00
parent 1497d42bd5
commit 3ad0c89511
2 changed files with 21 additions and 0 deletions

View File

@ -153,3 +153,21 @@ void AreaItem::setDigitalZoom(int zoom)
_digitalZoom = zoom;
_pen.setWidthF(_width * pow(2, -_digitalZoom));
}
void AreaItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event);
_pen.setWidthF((_width + 1) * pow(2, -_digitalZoom));
setZValue(zValue() + 1.0);
update();
}
void AreaItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event);
_pen.setWidthF(_width * pow(2, -_digitalZoom));
setZValue(zValue() - 1.0);
update();
}

View File

@ -27,6 +27,9 @@ public:
void setDigitalZoom(int zoom);
private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
QPainterPath painterPath(const Polygon &polygon);
void updatePainterPath();
QString toolTip() const;