plasma data engine / property loop

Martin Koller kollix at aon.at
Sun Jan 15 10:59:08 GMT 2017


On Sunday 15 January 2017 11:16:22 Kevin Krammer wrote:
> Hi Martin,

Hi Kevin,

> 
> On Sunday, 2017-01-15, 00:04:23, Martin Koller wrote:
> > Hi,
> > 
> > trying to fix the systemload applet (and new to QML), how can one solve the
> > problem: - a data engine delivers the number of CPU cores
> > - depending on this number, I need to separately "connect" to additional
> > sources in this data engine
> > 
> > This creates a property loop.
> > dataSources array depends on cores, but cores is set from dataSources
> 
> How is cores set from dataSources?

As shown below via onNewData

> Does the source() function below write to cores?

no, it reads from it: for (var i = 0; i < cores; i++) ...

I'll just attach the real qml file
The message I see is
SystemLoadViewer.qml:123:5: QML : Binding loop detected for property "connectedSources"


> 
> Cheers,
> Kevin
> 
> > E.g. (pseudo code)
> > 
> > property int cores: 0
> > dataSources: sources()
> > 
> > function sources() { ... create array depending on property "cores", like
> > "cpu/cpu<core index>/nice" ... }
> > 
> > onNewData: { cores = data.value }
> 

-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\                        - against proprietary attachments

Geschenkideen, Accessoires, Kulinarisches: www.lillehus.at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SystemLoadViewer.qml
Type: text/x-qml
Size: 18681 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde/attachments/20170115/21d4aa80/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 173 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde/attachments/20170115/21d4aa80/attachment.sig>


More information about the kde mailing list