|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
A QLabel with named rectangular hotspots that emit signals when clicked. More...
#include <qclickablelabel.h>


Signals | |
| void | mousePressed (const QString &hotspotName) |
| Emitted on mouse press within a hotspot (by name). More... | |
| void | mousePressed (unsigned int hotspotIndex) |
| Emitted on mouse press within a hotspot (by index). More... | |
| void | mouseReleased (const QString &hotspotName) |
| Emitted on mouse release within a hotspot (by name). More... | |
| void | mouseReleased (unsigned int hotspotIndex) |
| Emitted on mouse release within a hotspot (by index). More... | |
Public Member Functions | |
| QClickableLabel (QWidget *parent, Qt::WindowFlags f={}) | |
| Construct a clickable label. More... | |
| QClickableLabel (const QString &text, QWidget *parent, Qt::WindowFlags f={}) | |
| Construct a clickable label with initial text. More... | |
| ~QClickableLabel () override | |
| Destructor. More... | |
| void | AddHotspot (const QString &name, const QRect position) |
| Add a named hotspot at the given rectangle position. More... | |
| void | RemoveHotspot (const QString &name) |
| Remove a hotspot by name. More... | |
| void | RemoveHotspot (unsigned int hotspotIndex) |
| Remove a hotspot by index. More... | |
| void | RemoveAllHotspots () |
| Remove all hotspots. More... | |
Protected Types | |
| typedef std::vector< QRect > | RectVectorType |
| typedef std::map< QString, unsigned int > | NameToIndexMapType |
| typedef std::map< unsigned int, QString > | IndexToNameMapType |
Protected Member Functions | |
| void | mousePressEvent (QMouseEvent *e) override |
| void | mouseReleaseEvent (QMouseEvent *e) override |
| unsigned int | matchingRect (const QPoint &p) |
| returns index == m_Hotspots.size() if nothing is hit More... | |
Protected Attributes | |
| RectVectorType | m_Hotspots |
| NameToIndexMapType | m_HotspotIndexForName |
| IndexToNameMapType | m_HotspotNameForIndex |
A QLabel with named rectangular hotspots that emit signals when clicked.
Useful for overlaying interactive regions on a pixmap. Each hotspot is defined by a name and a QRect. When the user clicks within a hotspot, signals are emitted with both the hotspot name and index.
Definition at line 35 of file qclickablelabel.h.
|
protected |
Definition at line 116 of file qclickablelabel.h.
|
protected |
Definition at line 115 of file qclickablelabel.h.
|
protected |
Definition at line 112 of file qclickablelabel.h.
| QClickableLabel::QClickableLabel | ( | QWidget * | parent, |
| Qt::WindowFlags | f = {} |
||
| ) |
Construct a clickable label.
| [in] | parent | The parent widget. |
| [in] | f | Window flags. |
| QClickableLabel::QClickableLabel | ( | const QString & | text, |
| QWidget * | parent, | ||
| Qt::WindowFlags | f = {} |
||
| ) |
Construct a clickable label with initial text.
| [in] | text | The label text. |
| [in] | parent | The parent widget. |
| [in] | f | Window flags. |
|
override |
Destructor.
| void QClickableLabel::AddHotspot | ( | const QString & | name, |
| const QRect | position | ||
| ) |
Add a named hotspot at the given rectangle position.
| [in] | name | The hotspot name (used in signals). |
| [in] | position | The rectangular region of the hotspot. |
|
protected |
returns index == m_Hotspots.size() if nothing is hit
|
signal |
Emitted on mouse press within a hotspot (by name).
| [in] | hotspotName | The name of the pressed hotspot. |
|
signal |
Emitted on mouse press within a hotspot (by index).
| [in] | hotspotIndex | The index of the pressed hotspot. |
|
overrideprotected |
|
signal |
Emitted on mouse release within a hotspot (by name).
| [in] | hotspotName | The name of the released hotspot. |
|
signal |
Emitted on mouse release within a hotspot (by index).
| [in] | hotspotIndex | The index of the released hotspot. |
|
overrideprotected |
| void QClickableLabel::RemoveAllHotspots | ( | ) |
Remove all hotspots.
| void QClickableLabel::RemoveHotspot | ( | const QString & | name | ) |
Remove a hotspot by name.
| [in] | name | The name of the hotspot to remove. |
| void QClickableLabel::RemoveHotspot | ( | unsigned int | hotspotIndex | ) |
Remove a hotspot by index.
| [in] | hotspotIndex | The index of the hotspot to remove. |
|
protected |
Definition at line 117 of file qclickablelabel.h.
|
protected |
Definition at line 118 of file qclickablelabel.h.
|
protected |
Definition at line 113 of file qclickablelabel.h.