[Qt-qml] New with QT creator and QML

Matthew A matthewagustin at gmail.com
Mon Mar 29 11:19:12 CEST 2010


** Warning I am very new with this stuff so I might seem stupid and dumb **
Hello everyone I am trying out various things with the QT creator only
making QML projects
Am very excited with the possibilities but I noticed there isn a lot out yet
on the internet and the beginner tutorials (1st 2) are very easy, the
advanced too advanced
and I really want to learn this. Unfortunatly I don't see many posibilities
and literature for the newlings like me.

I am stuck with the following problem:


I have a QML project:
page1.qml and page2.qml

page2.qml contains:

import Qt 4.6

Item {

    width: 1000
    height:500
    Rectangle{
        width:500
        height:500
        color: "black"

    Loader {id: pageLoader}
        MouseArea {
            anchors.fill: parent
            onClicked: pageLoader.source = "page1.qml"
        }
    }
}


page1.qml contains:

import Qt 4.6

Rectangle {
    width: 400
    height: 400
    color: "white"
MouseArea { anchors.fill: parent; onClicked: { parent.color = "red" }
    Text{
        id: tekst
        text: "Click again"
    }

}
}


If I run page2.qml it runs, i click on the black area and it become white
(400x400) so partially black. I am supposed to click again to change it into
red.. and now this part doesn work.

When i Run page1.qml i can change it to red.
So my questions are:
What am I doing wrong? And am I using it correctly?

well thanks for reading!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100329/e5abf2b0/attachment.html 


More information about the Qt-qml mailing list