Declarative UI Integration, reprise
Alan Alpert
alan.alpert at nokia.com
Thu Sep 24 13:26:22 CEST 2009
On Thu, 24 Sep 2009 20:38:16 ext Marco Martin wrote:
> On Thursday 24 September 2009, Alan Alpert wrote:
> ...
>
> i'm compiling the branch right now, then i'll be able to give more in depth
> look.
>
> just quickly looking at it 2 things comes to my mind:
> -in the qml the word Plasmoid is used for the main applet. technically it
> indicates more the packages of scripted plasmoids that can contain the
> code, the desktop file, the graphics etc.. could even make sense there but
> maybe PlasmaApplet would be more correct?
Could be. I had the feeling though that we didn't want to use the word
'Applet' outside of code. The issue here is whether QML files are code - I like
to think of them as less code like and fully accessible to non-coders (and I'm
probably being overly optimistic). If we view QML at the same level as the
other scripting languages though then I agree with you.
> -most important: KineticApplet subclasses Applet, but plasma applets can
> subclass also Containment and PopupApplet, that are in turn Applet
> subclasses, in particular i think about 90% of todays applets are
> PopupApplets, so it should be possible to use it for different types, that
> wouldn't be possible subclassing just KineticApplet.
> A solution that comes to my mind is, (even if still keeping the
> scriptengine to do applets -just- with qml) making a widget that will
> contain more or less the code kineticapplet contains, but usable inside
> normal applets (that could or could not have other standard imperative code
> or other widgets in a normal layout, together that one) this would make it
> yes, more tricky but way more powerful.
Hmm, so you are suggesting a QGraphicsWidget subclass instead? It would mean
that, in the basic case, you have to setup the layout yourself. People can
probably live with that though :) .
That's actually a really good idea, since if you want just a QML item you
probably won't be wanting to write a C++ applet for it. I probably should have
noticed this since I didn't even use KineticApplet when I wrote my C++ applet
example (it had to subclass WeatherPopupApplet). The plasma items do need to
be given an Applet*, but I suppose that can be passed around. I agree that
this approach is more powerful.
We actually have a widget that displays QML already (QmlView). But using that
in Plasma means using a proxy widget and setting up the plasma specific things
yourself, which is undesirable. Watch out for a PlasmaQmlView in the
integration sometime soon.
--
Alan Alpert (aalpert on Freenode)
Software Engineer
Nokia, Qt Development Frameworks
More information about the Plasma-devel
mailing list