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 ?
-
@ManiRon
subclass QLabel, hijack the MousePressEvent and inside it call the static QToolTip::showText function
-
@J.Hilk can you provide any sample please
-
https://wiki.qt.io/Clickable_QLabel
https://forum.qt.io/topic/10532/how-to-show-tooltip-for-a-widget-from-code
-
@J.Hilk How can i add this in my MainWindow
-
Create a new class that subclasses QLabel, then set it into a layout on your MainWindow
OR
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
-