Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Balloon-tips with Qt

In my Qt application, I'd like to use balloons/balloon-tips as shown in the Windows user experience guide (not the system tray balloons).

Is this supported by Qt? I haven't found anything. Is there an Open Source library out there for this (Qxt does not have it)? What's the best way to create that myself?

like image 990
Sebastian Negraszus Avatar asked May 31 '26 07:05

Sebastian Negraszus


2 Answers

Search for QBalloonTip class (in Qt documentation (doxygen reference) and code base, look how it is implemented, and use similar technique.

like image 169
mloskot Avatar answered Jun 01 '26 20:06

mloskot


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.

like image 23
Nejat Avatar answered Jun 01 '26 22:06

Nejat