13 #ifndef qclickablelabel_h
14 #define qclickablelabel_h
63 void AddHotspot(
const QString &name,
const QRect position);
A QLabel with named rectangular hotspots that emit signals when clicked.
void mouseReleaseEvent(QMouseEvent *e) override
IndexToNameMapType m_HotspotNameForIndex
std::vector< QRect > RectVectorType
std::map< unsigned int, QString > IndexToNameMapType
void RemoveHotspot(const QString &name)
Remove a hotspot by name.
QClickableLabel(QWidget *parent, Qt::WindowFlags f={})
Construct a clickable label.
QClickableLabel(const QString &text, QWidget *parent, Qt::WindowFlags f={})
Construct a clickable label with initial text.
std::map< QString, unsigned int > NameToIndexMapType
NameToIndexMapType m_HotspotIndexForName
void mousePressed(const QString &hotspotName)
Emitted on mouse press within a hotspot (by name).
void mousePressEvent(QMouseEvent *e) override
void mousePressed(unsigned int hotspotIndex)
Emitted on mouse press within a hotspot (by index).
void RemoveAllHotspots()
Remove all hotspots.
~QClickableLabel() override
Destructor.
void mouseReleased(const QString &hotspotName)
Emitted on mouse release within a hotspot (by name).
RectVectorType m_Hotspots
void RemoveHotspot(unsigned int hotspotIndex)
Remove a hotspot by index.
void AddHotspot(const QString &name, const QRect position)
Add a named hotspot at the given rectangle position.
unsigned int matchingRect(const QPoint &p)
returns index == m_Hotspots.size() if nothing is hit
void mouseReleased(unsigned int hotspotIndex)
Emitted on mouse release within a hotspot (by index).