Settings for pure QML applet

Aaron J. Seigo aseigo at kde.org
Wed May 1 10:37:02 UTC 2013


On Wednesday, May 1, 2013 06:06:04 Jan Grulich wrote:
> > On Wednesday, May 01, 2013 11:45:22 Jan Grulich wrote:
> > > Dne 1.5.2013 11:11, Sebastian Kügler napsal(a):
> > > > Hi Jan,
> > > > 
> > > > On Wednesday, May 01, 2013 04:58:28 Jan Grulich wrote:
> > > >> is there any other option how to add settings for pure QML applet?
> > > >> I've
> > > >> found only KConfigXT where I can't use custom widgets or I can load
> > > >> KCModule to applet settings but this configuration is not saved in
> > > >> plasma-desktop-appletsrc file and then I can't use
> > > >> plasmoid.readEntry()
> > > >> in
> > > >> QML.
> > > > 
> > > > KConfigXt (and what you describe) is the only way to do it in Plasma1.
> > > > 
> > > > In Plasma2, you can add a config.qml, which holds the configuration.
> > > > 
> > > > If you want to prepare for Plasma2, you can do the configuration in
> > > > QML,
> > > > and add a button to open it, for example in a PlasmaComponents.Dialog,
> > > > or
> > > > you'll have to do a C++ appplet.
> > > 
> > > Maybe something like this may solve my problem. I can create custom C++
> > > widget and expand it to QML and then open it in PlasmaComponents.Dialog.
> > 
> > How do you mean "Write custom C++ wigdet and expand it to QML"?
> 
> Like we have with the traffic monitor in plasma-nm. It's QWidget written in
> C++ and expanded as QML plugin via qmlRegistertype().

As an aside: TrafficMonitor is actually a QGraphicsWidget, which is better than a QWidget here. 
However, it will still fail in QML2 and will need to be ported then.

The biggest reason I can see for it being a QGraphicsWidget is to use Plasma::SignalPlotter. So 
that is understandable .. Sean Reich had done some work to build a qml2 replacement for 
SignalPlotter, so in the QML2 version of this plasmoid, TrafficMonitor should be able to either be 
removed entirely or ported to QQuickItem.

> > > The second thing I need is saving QStringList via plasmoid.writeEntry()
> > > in QML and I don't know if this is possible. I know that it's possible

Yes, this works just fine.

-- 
Aaron J. Seigo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130501/f218c059/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130501/f218c059/attachment-0001.sig>


More information about the Plasma-devel mailing list