QML and Plasma -> progress()
Marco Martin
notmart at gmail.com
Mon Sep 20 22:33:30 CEST 2010
On Friday 17 September 2010, Marco Martin wrote:
> On Thursday 16 September 2010, Marco Martin wrote:
> > Hi all,
> > the status of an AppletScript for writing plasmoids in pure QML is
> > progressing rather well, i thought to write a detailed status
> > report/documentation before significative design problems go too far in
> > the implementation, be patient, is really long, but it can be used as a
> > basis for a future documentation.
I'll answer myself for hystorical records:
> Almost implemented services support (there is a qml nowplaying plasmoid to
> test it), but there are two quite ugly problems (that derive from not
> having access to the engine):
> services:
> we need to manipulate kconfiggroup from javascript, but we can't registed
> the conversion to scriptvalues: that is valid for any type tht is not a
> qobject, oh joy.
> at the moment resolved with a function
> AppletInterface::setOperationValue(KConfiggroup, key, value)
this is unfortunately the way to go(tm)
also kontact mobile did this way.
since we can't register handlers for KConfiggroup in the engine we can't
access, i think should be in the KDE global object konact is using too.
for now we can keep a copy, sometimes that class could even go into kdelibs
tough i'm not sure since we probably need way less that kontact if we want
keep the "sandboxed" behaviour, so a more limited tough api identical versdion
could be kept in plasma.
> second problem:
> services support the neat feature of being automatically associated to a
> widget, so doing someting like service.associateWidget(stop, "stop");
>
> now, i can call this from the qml javascript, but the thing that gets in
> the parameter instead of the widget is some misterious value that i'm not
> even sure it started as a pointer (no, it's not a QObject*)
> so anohter thing that would not be possible is to pass pointers to the
> internal qml items passed by id in an external c++ object.
> i see this as another potentially limiting thing.
this is actually a QScriptValue (not pointer) so to make for instance
Service::associateWidget(QGraphcisWidget, QString) work, the only way to make
this work is to add another method like
associateDeclarativeWidget(QScriptValue, QString)
Cheers,
Marco Martin
More information about the Plasma-devel
mailing list