void StyledLabel::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { Clickable click = _clickables.atCursorPos(posToCursor(event->posF())); if (click.isValid()) emit clickableActivated(click); } }
void StyledLabel::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() == Qt::NoButton) { Clickable click = _clickables.atCursorPos(posToCursor(event->posF())); if (click.isValid()) setHoverMode(click.start(), click.length()); else endHoverMode(); } }