Revision 64125fb...

Go back to digest for 1st May 2011

Features in KDE Base

Artur Duque de Souza committed changes in [kde-runtime] /declarativeimports/core:

QML Bindings for Plasma::ToolTips

Implementation of a proxy to make it easy to declare tooltips in QML,
that will use Plasma::ToolTipManager to display tooltips in any item
that is declared in QML.

The syntax is:

import org.kde.plasma.core 0.1 as PlasmaCore

PlasmaCore.ToolTip {
target: id_of_the_target
mainText: "hello"
subText: "world"
image: "konqueror"

The syntax looks pretty straightforward and simple. "id_of_the_target"
is the id of the element which will show the tooltip in case it's hovered.

If the target is a QGraphicsWidget, the code path is really simple but if
it's a QDeclarativeItem, then we create a wrapper (that is a QGraphicsWidget)
and setup that in a way that we set this wrapper as the target on Plasma's
API. For libplasma2 we may want to change this so it's more generic (and
also put this together with the components).

Right now there is two open issues for me:

1) we should use "image" or "icon"? Allowing the use of a image that is
a string that identifies the icon for KIconLoader seems simpler and more
beautiful to me, but it would be nice to specify a random QPixmap. Besides
being able to use the bindings for QIcon it doesn't look very good. Marco,
do you have any thoughts on this issue?

2) for touch oriented UIs, the tooltip as it is right now is not very
useful. Is there any "touch" scenario where we may want to use them?

Signed-off-by: Artur Duque de Souza

File Changes

Added 2 files
  • /declarativeimports/core
  •   plasma/tooltip.cpp
  •   plasma/tooltip.h
2 files changed in total