Qt 6.11 is out! See what's new in the release
blog
How to show tooltip for a widget from code
General and Desktop
8
Posts
4
Posters
33.5k
Views
1
Watching
-
Hello all,
I want to show tooltip for QLineEdit from a code as a hint for a user that there (in lineEdit) is something wrong.
But I cannot find how to do it. I want to ask if it is possible to show tooltip by the code?Thank in advance,
Jarda -
Try this:
@QToolTip::showText( widget->mapToGlobal( QPoint( 0, 0 ) ), errorString );@ -
Thanks very much p-himik. That is exactly what I needed.
-
This will show toolTip only if you hold your mouse cursor on this widget for a while. Jarda wants to show it on demand from his code.