18#ifndef MOTIV_GENERICINDICATOR_HPP
19#define MOTIV_GENERICINDICATOR_HPP
22#include <QGraphicsItem>
31template <
class T,
class G>
requires std::is_base_of_v<QAbstractGraphicsShapeItem, G>
88 std::function<void(T*)> onDoubleClick_;
89 std::function<void(T *element)> onSelected_;
A generic indicator bundling common interaction behaviours.
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
void setOnSelected(const std::function< void(T *)> &fn)
Registers a select handler.
void setOnDoubleClick(const std::function< void(T *)> &fn)
Registers a double click handler.
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
virtual bool respondToEvent(QPointF)
Checks whether the indicator should react to an event at a given point.