Inherit Q3CanvasView and override:
bool QWidget::event ( QEvent * e ) [virtual protected]
You can show a dynamic tooltip like this:
bool MyCanvasView
::event(QEvent *event
) {
if (event
->type
() == QEvent::ToolTip) { QHelpEvent *helpEvent
= static_cast<QHelpEvent
*>
(event
);
// compare event position and canvas item positions
// and set tooltip text accordingly
QToolTip::showText(helpEvent
->globalPos
(),
"");
}
}
bool MyCanvasView::event(QEvent *event)
{
if (event->type() == QEvent::ToolTip) {
QHelpEvent *helpEvent = static_cast<QHelpEvent*>(event);
// compare event position and canvas item positions
// and set tooltip text accordingly
QToolTip::showText(helpEvent->globalPos(), "");
}
return QWidget::event(event);
}
To copy to clipboard, switch view to plain text mode
Bookmarks