Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip for QPushButton

Is there a possibility to add a tooltip to a QPushButton. I mean, that when you roll over the button a small textbox appears (usually yellow) and tells users what this button is doing.

Thank you.

like image 377
buddy Avatar asked Nov 06 '11 19:11

buddy


People also ask

How to show tooltip in pyqt5?

pyqt5 Getting started with pyqt5 Showing a tooltip To create a tooltip, we call the setTooltip() method. We can use rich text formatting. We create a push button widget and set a tooltip for it. The button is being resized and moved on the window.

How to add tooltip in Python?

You can add a tooltip by calling . setToolTip("text") on a widget. This is often used to assist the user.


1 Answers

QPushButton is a QWidget, so it has the setToolTip(const QString&) like all other widgets.

Either that's what you're looking for, or you're after the setWhatsThis(const QString&) function. More info in the QWhatsThis documentation.

like image 58
Mat Avatar answered Oct 05 '22 11:10

Mat