Tooltips to QML: PlasmaCore.Dialog questions

Mark markg85 at gmail.com
Sun Jun 3 21:07:03 UTC 2012


Hi,

Since "some" people seem to blame me a little for asking question in
private mails.. I will throw a bunch of questions in the list.

For starters, my tooltip "endeavors" are really starting to show now. I got
the tooltip somewhat working with nice red text in it and a nice red square
for the icon. That's all in QML and that's working fine.
The issues i seem to be getting are related to window hints and the dialog
itself.

Just FYI, here is the - very basic and primitive - QML thus far:
http://paste.kde.org/492464/ not complicated at all. And if you're
wondering.
The "ToolTipData" is just the PRIVATE class "ToolTip" exposed to QML
through: rootContext()->setContextProperty("ToolTipData", this); (this =
class ToolTip)
ScreenGeometry is: rootContext()->setContextProperty("ScreenGeometry",
QApplication::desktop()->screenGeometry());

Here are the issues i have so far:
1. The current tooltip classes send a pixmap as an icon (ToolTipManager ->
ToolTipContent -> ToolTip). That's fine, but how do i send the pixmap from
C++ to QML and actually use it?
2. Somehow the tooltip itself shows itself just under the middle of the
screen when i open it up for the first time. If i hover over another item
for an updated tooltip the position corrects itself. I don't know why this
is happening. The x position seems to be fine, the y position seems to be
wrong.
3. The tooltip seems to have a minimal width + height of around 100 pixels.
Where is that minimal limit set and how can i get rid of it?
4. Which flags do i need to have for a tooltip? If i put Qt.ToolTip in it i
get double shadows... Right now i have windowFlags:
Qt.X11BypassWindowManagerHint in QML (as you can see). No flags are set in
C++.

I'm intentionally not posting the C++ coding yet :) It's not of much use
for the above questions anyway.
Thus far it's going to look like a missive code cleanup in the C++ ToolTip
coding.

My tooltip.cpp is only about 240 lines and half of it is commented code!
Though there is still the big issue of window previews..

Either way, i hope some folks can answer the above questions.
Also, all your responses will help improve the docs:
http://techbase.kde.org/Development/Tutorials/Plasma/QML/API since i will
update that one with it as well.
Talking about docs.. How do you add a proper code snippet in the wiki? I
tried doing that
http://techbase.kde.org/Development/Tutorials/Plasma/QML/API#Dialog but it
looks a bit ugly.

Cheers,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120603/522de325/attachment.html>


More information about the Plasma-devel mailing list