QML and Plasma -> progress()

Marco Martin notmart at gmail.com
Thu Sep 16 17:58:08 CEST 2010


On Thursday 16 September 2010, Aaron J. Seigo wrote:
> On Thursday, September 16, 2010, Marco Martin wrote:
> > * Plasma::QMLWidget -> i a qgraphicswidget that loads a qml file in it,
> > and keeps the context/engine/etc, it shortens an otherwise long and
> > repetitive task of loding qml files with eventiual parse error
> > management, to be used in c++ plasmoids, where complex logic is needed.
> > * QML AppletScript: to write applets completely in QML, (uses a QMLWidget
> > internally)
> 
> what's the possibility of using QML from a Javascript plasmoid?

it is possible, it could get a bit confusing tough.
right now it's possible to create from the js plasmoid a qmlwidget and load a 
qml file from there.

the thing that i find a bit weird is the following:
it would be possible to have widgets and manage dataengines from the "outside" 
javascript and from the qml/javascript that lives inside the widget.
the two things would live in two separate worlds, almost incomunicable (thre 
could be some bindings to getting/setting properties from the objects in the 
qml context from javascript)

there would be two engines, because we again have the problem that the 
internal script engine of qml is not accessible, that means also if we want to 
access a "plasmoid" object from qml or the javascript inside qml we have to 
use another appletinterface instance (tough registring the same instance in 
both engines could work withut exploding, it has to be tried)

> tbh, i'm less interestied in a QMLAppletScript as i am in being able to use
> QML from inside a Javascript, for a number of reasons including clarity of
> documentaiton and simplifying the learning curves (one solution rather than
> multiple ones that you have to decide which is least-worse for your goals)

as i said, i don't think would really simplify the learning curve, because one 
would have to manage two "types" of javascript, with a difference between them 
that is quite an implementation detail (being on two engines)
now, i'm in favour of trying to do the two things in the same place to share 
the code of appletinterface, even tough i had to do some modifications to make 
it work, but i think they managed to make it so alien from a "normal" QtScript 
that the two things are not really conciliable anymore, it sucks and i would 
like to see solutions for it, but i don't think it's feasible

Cheers,
Marco Martin


More information about the Plasma-devel mailing list