Just a little more help needed with QML and Data Engine

Eric Mesa ericsbinaryworld at gmail.com
Sun Jan 22 22:51:52 UTC 2012


Here's what the data in the data engine looks like:
http://i.imgur.com/MBtLw.png

It's a QString.

I want to access that from within my QML Program.  But I keep getting the
error:

Result of expression 'viewsSource.data["75"]' [undefined] is not an object.


Here's the code in my QML program:


import Qt 4.7

import "content"

import QtWebKit 1.0

import org.kde.plasma.core 0.1 as PlasmaCore


Rectangle {

    id: window

    width: 360

    height: 360


    PlasmaCore.DataSource {

         id: viewsSource

         engine: "flickrviewsengine"

         connectedSources: ["75"]

         interval: 0

         onSourceAdded: connectSource(viewsSource)

         Component.onCompleted: connectedSources = sources

     }


    property string currentGroup: viewsSource.data["75"]["Group 75"]
//"/home/ermesa/bin/qml/plasmoids/flickrviews/testgrouprss"

    property bool loading: feedModel.status == XmlListModel.Loading


    XmlListModel{

            id:feedModel

            source: window.currentGroup //viewsSource.data["75"]["Group 75"]

            query: "/rsp/photos/photo"

            XmlRole { name: "title"; query: "@title/string()"}


        }


    Row {

        width: 360

        height: 43

        Rectangle{

            width: window.width; height: window.height

            color: "blue"


            Text {

                id: testtext

                text: qsTr("buttons will go here!")

            }

        }

    }


    Row {

        x: 0

        y: 43

        width: 370

        height: 317

            Rectangle {

                width: window.width/3+10; height: window.height

                color: "#efefef"


                ListView {

                    id: list

                    width: window.width/3; height: window.height

                    model: feedModel

                    delegate: ItemDelegate {}


                    highlight: Rectangle { color: "lightgray" }

                    highlightMoveSpeed: 9999999

                }


            }


            Rectangle {

                width: window.width/3*2

                height: window.height

            }

    }

}




What am I missing?

Thanks!

--
Eric Mesa
http://www.ericsbinaryworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120122/96d1d733/attachment-0001.html>


More information about the Plasma-devel mailing list