Assuming that you want to read the coordinates when moving the cursor (as in many graphics or CAD applications), you really do not want to override QCursor .
The most efficient approach depends on which widget will provide the coordinates, but in most cases the easiest way would be to setMouseTracking(true) for the widget and override it with mouseMoveEvent(QMouseEvent* event) to display QToolTip as follows:
void MyWidget::mouseMoveEvent(QMouseEvent* event) { QToolTip::showText(event->globalPos(),
Usually you will not βclickβ such a tooltip; you should use QWidget::setToolTip(const QString&) or write hints in QWidget::event(QEvent*) . But a normal QToolTip only appears after a short delay, but you want them to be constantly updated.
I must say that I have not tried this, but so I did. Hope this helps!
source share