Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to show a tool tip when a QLabel is clicked or pressed?
I want to show the tool tip for a QLabel , but i want to make the QLabel as hyperlink and when the link is pressed i want to pop the tool tip , Is there a way we can do this ?
subclass QLabel, hijack the MousePressEvent and inside it call the static QToolTip::showText function
@J.Hilk can you provide any sample please
@J.Hilk How can i add this in my MainWindow
Pl45m4 last edited by
Create a new class that subclasses QLabel, then set it into a layout on your MainWindow
you follow this to set a dummy widget (QLabel in your case) in Qt Designer where you want to have your custom label. Then promote it to your customLabel-class
Pradeep P N last edited by
Few reference examples hope these will help :
All the best