Just a little more help needed with QML and Data Engine

Eric Mesa ericsbinaryworld at gmail.com
Mon Jan 23 00:27:12 UTC 2012


Ran things through the QT Creator debugger.  Looks like it wasn't
connecting to my flickrviewsengine because the isvalid variable was false.
 So I changed things up a bit.  Decided to use the Time engine because
that's the one always used in examples.  Still got the same error.  Here's
my current code:

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"]  //may end up removing this line
and leaving in Component.....line

         interval: 0

         Component.onCompleted: connectedSources = sources

         onSourceAdded: connectSource(source)

     }


    PlasmaCore.DataSource {

         id: timer

         engine: "time"

         interval: 0

         Component.onCompleted: connectedSources = sources

         onSourceAdded: connectSource(source)

     }


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

    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

            }

    }

}



And here's the error:

KGlobal::locale::Warning your global KLocale is being recreated with a
valid main component instead of a fake component, this usually means you
tried to call i18n related functions before your main component was
created. You should not do that since it most likely will not work

TypeError: Result of expression 'timer.data["Local"]' [undefined] is not an
object.


So I figure I need to solve the problem with the known working time engine
before I tackle what's wrong with mine.  (I think it's because I added the
engine as root - it doesn't so up in my user's engine explorer - only in
root's)
--
Eric Mesa
http://www.ericsbinaryworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120122/87d42fe5/attachment.html>


More information about the Plasma-devel mailing list