kinetic-declarative plasma integration

Marco Martin notmart at
Wed May 13 14:05:40 CEST 2009

On Wednesday 13 May 2009, Alan Alpert wrote:
> Hi Plasma devs,
> Those of you following Qt Labs closely will have heard about Qt Kinetic's
> Declarative UI
> . As
> Declarative UI is targeted towards enhancing the same sorts of applications
> as Plasma, plasma integration is a good real-world fit. So we've throw
> something together (it's in playground/base/plasma/kinetic-declarative) and
> hope that it might be useful in your plans to add Netbook and media center
> components; declarative UI is designed to help create embedded device style
> UIs! The Plasma integration we've done allows plasmoids to be written
> exclusively in QML, or in conjunction with C++. I'll let the blog posting
> handle all the riveting details on Declarative UI itself, and focus on
> providing more technical details about the plasma integration we've done.

taking a quick look rigt now, i still didn't understood whell the whole thing, 
but i have some (maybe naive) questions:
when the items are declared, like in the dial example with 
Item {
    property real value : 0

    width: 210; height: 210
etc etc..

what happens behind the scenes? does a real widget get created? qwidget? 
so, as far i understood from your message is still not possible to use plasma 
widgets, but will it be possible in the future? (so defining for instance a 
Plasma::Pushbutton in qml syntax..)
what i think we would need is defining uis using our widgets in this way, 
keeping them reachable from eventual c++ (or other bindings) code
and also the layouting information (how it does move/resize/update the 
widgetS?  it uses qgraphicslayouts?)

those are the things i'm wondering after a quick look, after playing a little 
bit with it probably i will have more meaningful ones :)

Marco Martin

> Firstly the suggested plan for the plasma integration is that it lives in
> playground and is not intended for general use until Qt Declarative
> stabilizes. Where it goes in terms of technical improvements is unknown;
> but we'd love to see what people do with it. So far it's not complete, but
> provides a good glimpse of how Declarative UI could benefit a project like
> Plasma. Gaps in the integration that we're aware of include setting the
> background hint from QML, using plasma widgets from QML and refactoring 
> QML frontend part of the kinetic plasmoid into a library class you can just
> inherit from and call setQml() on.
> If you checkout the plasma integration repository you'll find that it
> provides a script engine that can run packages comprised of QML files, a
> plasmoid that acts like the qmlviewer program and an example of an applet
> written in C++ that draws on a QML file for its fluid UI. There is also a
> file explaining how to use plasma features like the data engines and theme
> easily in your QML files, along with the standard QML described in the labs
> post. You need only the Qt Kinetic Declarative UI repository and KDE trunk
> as recent as 4.3 beta 1 (r964546) and you can add Declaratively styled
> plasmoids to your desktop. The attached screenshot shows my desktop 
> in QML plasmoids, although the animation doesn't get conveyed well in
> pictures. The plasmoids to the left are the plasma-integration examples,
> and the plasmoids to the right are examples for just regular Qt
> Declarative. Sadly I'm not technically competent in graphic design and so
> the plasma integration repository contains a dearth of compelling examples.
> But on the plus side it's easy to run any of the Declarative UI examples as
> simple plasmoids if you really like them. Note that the examples in the
> screenshot that weren't designed as plasmoids have had minor changes (set
> 'clip: true' on the root item and remove any opaque background image) to
> make them fit in better.
> There is only one good example in the plasma integration repository, a
> weather plasmoid. Because there's only one, it has been a little warped so
> that it can be used in a variety of different ways (you can run it as an
> applet, as a non-applet C++, through the script engine and through the
> kinetic plasmoid). Despite this the weather example is still a surprisingly
> small amount of code to get a fairly fluid visualization of the weather
> data engine. And that 'code' does not need to include C++ (although the
> weather data engine is not designed to be set up declaratively). If even I
> can make something that looks decent I can't wait to see what actual
> designers do with it.
> Qt Kinetic Declarative UI is still under development and not ready for
> general use, the plasma integration doubly so. However, we'd love for you
> to play around with it and tell us your thoughts. This will help us improve
> Declarative UI even further before release.

More information about the Plasma-devel mailing list