Proposal for a new class: KToolTip

Gábor Lehel illissius at gmail.com
Sun Aug 20 13:06:10 BST 2006


On 8/16/06, Jarosław Staniek <js at iidea.pl> wrote:
>
> Hello,
> A proposal:
> Customizing contents of QToolTip was not possible in Qt3, what lead to
> multiple implementations based on QFrame with WStyle_Tool style, e.g.:
>
> kdebase/libkonq/konq_filetip.cc
>
> In fact I implemnted another one (for displaying a zoom for QVariant database
> data in Kexi) and who knows how many other implementations
> exist.
>
> Even by displaying Qt HTML content via QToolTip::showText() in Qt4 can be not
> enough and it will be impossible to style. Instead, a common class could be
> developed for kdeui with a few utility methods.
> One of them can be to displaying an icon + description like in konq_filetip.cc
> (using a Qt HTML), other could be to display a preview of a larger multiline
> text. Finally a paint event can be used to reimplement the display for other
> cases.
>
> Sometimes, an option displaying some sort of arrow is usable, like here:
> http://kexi-project.org/pics/1.1/date_validator.png
>
> A be benefit from reusing this code could be that for typical cases the
> tooltip looks always the same. Optional thing would be styling using (yes, all
> the fancy effects that Kicker has in kde3 and so people/artists proposed e.g.
> on KDE-look.org).
>
> I can add the stuff to the kdeui TODO list, and later can add an initial stuff
> based on my code, konq_filetip.cc code and what whatever people people point
> too in the meantime.

I submitted a bug/suggestion with Trolltech some time ago about adding
QToolTIp::showDocument( QPoint, QTextDocument ) or something of the
sort, which could let you use custom resources you've added to the
document yourself; as this was the second or third time I had to
reimplement QToolTip in order to show thumbnails of internal
application data. The response I received was that they hadn't
considered such a method, but would look into it if many people
requested it. I've referred them to this thread. (Although, many of
the ideas in it are even beyond the scope of simply passing in a
QTextDocument).


-- 
Work is punishment for failing to procrastinate effectively.


More information about the kde-core-devel mailing list