Hey guys,<br><br>sorry for bothering you again, but I'm still stuck with making
the popupApplet plasmoid work with qml bindings. Since inside qml
world wasn't working at all, I've tried to move one step back, and made a
simple plasmoid in pure JS to test the popupApplet correctness; below, here it is
what I've found.<br>First, according to [0], popupIcon is declared as: <br><br><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:'Times New Roman';font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:collapse;color:rgb(34, 34, 34);font-family:'Droid Sans', 'Liberation Sans', 'Bitstream Vera Sans', sans-serif;font-size:14px;line-height:16px;text-align:justify"><pre style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;outline-width:0px;outline-style:initial;outline-color:initial;font-size:11px;vertical-align:baseline;background-color:transparent;white-space:pre-wrap;background-repeat:initial initial">
Q_PROPERTY(QIcon popupIcon READ popupIcon WRITE setPopupIcon)</pre></span></span><br>Fair enough. Therefore, my first test plasmoid was:<br><br>mainLayout = new LinearLayout(plasmoid);<br>label = new Label();<br>label.text = '<font color=\'red\'>Hello JavaScript!!</font>';<br>
mainLayout.addItem(label);<br>plasmoid.setMinimumSize(100,100);<br>plasmoid.popupWidget = label;<br>plasmoid.setPopupIcon(new QIcon("plasma"));<br><br>Result: plasmate & plasmoidviewer crashes every time :\<br>
I've replaced the last line with<br><br>plasmoid.popupIcon = new QIcon("plasma");<br><br>And
now I can see the label correctly placed inside the plasmoid. But, when
I placed it inside a panel and reduce the panel size, the plasmoid
instead of collapsing to an icon, appeared on the top left
corner of the screen ..<br><br>At this point (I didn't mentioned all the attempts I made), I tried the advice was told me (even if popupIcon is a
QIcon property) so I replaced, again, the last line with:<br><br>plasmoid.popupIcon = "plasma";<br><br>And now I didn't see that label in the panel, so I was kind of "yay"!<br>
But the "plasma" icon was still missing, and clicking the invisible
plasmoid popped out a crappy widget with that label inside. The strangest
part was when I moved the plasmoid from the panel to the desktop: even
increasing the plasmoid size, the label never came visible within it. So
I tried to click inside the plasmoid and, without any reason, the crappy popup
with the label appeared again.<br>
I've attached a screenshot so you can see
what happened, because it's really weird: the
popup is placed over the folderview plasmoid (I've set the text color to 'red' to improve its visibility) and, when I tried to click that
popup, the standard menu (the usual plasma-desktop mouse-plugin) came out, like there were no
plasmoids under the mouse cursor at all :\<br><br>As a side note, plasmoid.popupEvent() is not working at all, plasma-dekstop complains saying "Object::connect: No such signal Plasma::PopupApplet::popupEvent(bool)" :(<br>
<br>
Seems like popup applets are a bit broken with JS (and, by extension, qml), or it's just me?<br>
Any hints/suggestions (examples in kdeexample module ;) ?<br>Sorry for the long and a bit angry email, but it's kinda frustrating playing with 5 lines of code for days and still get no results :(<br><br>Cheers,<br><br>
Diego<br><br>
<br>
<br>[0]: <a href="https://projects.kde.org/projects/kde/kdebase/kde-runtime/repository/revisions/master/entry/plasma/scriptengines/javascript/plasmoid/appletinterface.h" target="_blank">https://projects.kde.org/projects/kde/kdebase/kde-runtime/repository/revisions/master/entry/plasma/scriptengines/javascript/plasmoid/appletinterface.h</a><br clear="all">
<br>-- <br>H: Who is Watson without Sherlock Holmes?<br>G: Watson was a genius in his own right.<br><br>My personal blog: <a href="http://polentino911.wordpress.com/" target="_blank">http://polentino911.wordpress.com/</a><br>
<br>