More version guards.

This commit is contained in:
Brübach, Lukas 2025-11-25 11:04:12 +01:00
parent add93bf09a
commit 57edb03dc8

View file

@ -108,9 +108,17 @@ void ColorBar::mouseMoveEvent(QMouseEvent *event)
if (!isHovered || colors.isEmpty())
return;
QString text = tooltipForPosition(event->position().x());
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
int x = int(event->position().x());
QPoint gp = event->globalPosition().toPoint();
#else
int x = event->pos().x();
QPoint gp = event->globalPos();
#endif
QString text = tooltipForPosition(x);
if (!text.isEmpty())
QToolTip::showText(event->globalPosition().toPoint(), text, this);
QToolTip::showText(gp, text, this);
}
QString ColorBar::tooltipForPosition(int x) const