18

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.

Necrolis
  • 25,836
  • 3
  • 63
  • 101
buddy
  • 821
  • 2
  • 12
  • 30

1 Answers1

34

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.

Mat
  • 202,337
  • 40
  • 393
  • 406
  • 2
    I just came across this and noticed that the links are broken. Take [this](http://qt-project.org/doc/qt-5/qwidget.html#toolTip-prop) and [that](http://qt-project.org/doc/qt-5/QWhatsThis.html) – Theolodis Aug 21 '14 at 07:50
  • Thanks for the heads up @Theolodis, fixed! – Mat Aug 21 '14 at 07:56