Qt stock tooltip position can be blocked by cursor (user could have large cursor size).
Current Seamly2D tooltip:
With tooltip offset to top right:
Guessing cursor size is difficult, better just offset it to top right.
Can be done by QWidget::eventFilter(QObject *, QEvent *)
bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
if (event->type() == QEvent::ToolTip) {
// Cast to a help event to get the coordinates
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
// Cast the object to a widget so we can get its tooltip text
QWidget *widget = qobject_cast<QWidget *>(obj);
if (widget && !widget->toolTip().isEmpty()) {
// Show the tooltip with an offset
// This bypasses the default blocking behavior
QToolTip::showText(helpEvent->globalPos() + QPoint(20, -50),
widget->toolTip(),
widget);
return true;
}
}
// Pass everything else through to the original widget
return MainWindowsNoGUI::eventFilter(obj, event);
}