mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 17:44:01 -07:00
More version guards.
This commit is contained in:
parent
add93bf09a
commit
57edb03dc8
1 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue