can't access methods of data engine output for digital-clock declarative example
todd rme
toddrme2178 at gmail.com
Thu Jun 2 23:22:29 CEST 2011
Hi,
I am working with the digital clock qml example in
kdeexamples/plasma/declarative/digital-clock
One thing I am trying to do is extract and output the seconds from the
dataengine. The original example has this at line 54:
Text { text: 'Time Is ' + dataSource.data['Local']['Time']; }
This displayed the time correctly. I converted it to:
Text { text: 'Time Is ' + dataSource.data['Local']['Time'].second(); }
This returned following error:
main.qml:54: TypeError: Result of expression
'dataSource.data['Local']['Time'].second' [undefined] is not a
function.
Based on a suggestion on IRC, I next tried accessing the string data
directly (I know this will get the hours not the minutes, it doesn't
matter as long as it gets something):
Text { text: 'Time Is ' + dataSource.data['Local']['Time'].split(":")[0]; }
This, however, returned essentially the same error:
main.qml:54: TypeError: Result of expression
'dataSource.data['Local']['Time'].split' [undefined] is not a
function.
Does anyone know what might be going wrong here? I am using KDE
4.6.80 and the latest git version of kdeexamples.
-Todd
More information about the Plasma-devel
mailing list