Commit Graph

8 Commits

Author SHA1 Message Date
Dmitry Ashkadov
46e7b8065f Support of QIcon and QPixmap for QML item PlasmaCore.Tooltip 2012-10-23 20:58:50 +04:00
Aaron Seigo
35580a01be only set an image when we have one 2011-11-30 15:15:54 +01:00
Marco Martin
42ddc80867 check for scene sxistence 2011-11-27 17:03:05 +01:00
Marco Martin
b24cc1646f guard against a null scene 2011-11-16 11:23:15 +01:00
Marco Martin
2bb8101e6f check the pointer 2011-11-03 13:49:29 +01:00
Diego Casella
97bfbf07a5 use QWeakPointer for m_declarativeItemContainer 2011-04-29 12:50:18 +02:00
Diego Casella
80b71fe2f4 check m_declarativeItemContainer before deleting it 2011-04-29 11:22:44 +02:00
Artur Duque de Souza
f1e61647b6 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?

CCMAIL:mart@kde.org
Signed-off-by: Artur Duque de Souza <asouza@kde.org>
2011-04-27 19:45:48 -03:00