Search code examples
qttextbuttoncommentsrollover

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.


Solution

  • 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.