QML DataSource

Marco Martin notmart at gmail.com
Thu Oct 6 08:05:47 UTC 2011


On Thursday 06 October 2011, Viranch Mehta wrote:
> Hi all,
> 
> I am facing a very annoying problem in QML plasmoids with the dataengines.
> The following does not seem to work ever for almost all dataengines:
> 
> PlasmaCore.DataSource {
>     id: dataSource
>     engine: "someEngine"
>     onSourceAdded: print (data[source]["some_valid_key"];
> }
> 
> The print statement always throws data[source] is [undefined]. This happens
> with
> most engines, esp with those engines where sources are added/removed
> dynamically
> by the engine. This has been very annoying, any help will be awesome!

uhm, i could think about a structural problem there (iirci faced this problem) 
basically onSourceAdded data[source] is not ready yet, will be in the nexo 
loop
so you should do onSourceAdded: connectSource(source) then iirc could still be 
not ready, if you read it after a while (like a timer) then should be ready

but yeah, is probably something to fix there

Cheers,
Marco Martin


More information about the Plasma-devel mailing list