Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt tooltip with arrow

Tags:

c++

tooltip

qt

qt5

I have Qt 5.2.1 widgets-based project. I want to show cool tooltip with arrow while user hovers some labels (or any other widgets that can show image), like this:

qtooltip with arrow

But i found no examples for this. So am i able to do this with QToolTip? Or should i use another widgets to reach same look instead?

It is no matter what classes and styles i have to use, i need to reach similar effect any way.

I've tried to customize QToolTip with basic CSS but had failed.

like image 674
serg.v.gusev Avatar asked May 07 '14 16:05

serg.v.gusev


1 Answers

You can use QBalloonTip which is an internal class defined in

QtDir/5.2.1/Src/qtbase/src/widgets/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 171
Nejat Avatar answered Sep 24 '22 14:09

Nejat