Tooltip for QPushButton

buddy picture buddy · Nov 6, 2011 · Viewed 16.8k times · Source

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.

Answer

Mat picture Mat · Nov 6, 2011

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.