user228662
user228662

Reputation: 33

How to create tooltips as bubble boxes in Qt?

I have trying implementing tooltips as bubble boxes in qt, without any luck. Even tried placing a css file in qt having code to mainpulate tooltips, but of no use. Any methods to create tooltips as bubble boxes in qt widgets?

Upvotes: 3

Views: 1788

Answers (1)

Nejat
Nejat

Reputation: 32675

You can use QBalloonTip which is an internal class defined in :

  • Qt 5:

    QtDir/Src/qtbase/src/widgets/util/qsystemtrayicon_p.h

  • Qt 4:

    QtDir/src/gui/utils/util/qsystemtrayicon_p.h

QBalloonTip inherits QWidget and it is implemented in qsystemtrayicon.cpp at the same directory. It has the following method to show a balloon tip:

void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)

You can modify the source code of this class to have your desired balloon tip.

Upvotes: 2

Related Questions