[Qt-qml] New with QT creator and QML
henrik.hartz at nokia.com
henrik.hartz at nokia.com
Mon Mar 29 14:11:03 CEST 2010
Hi,
This is a problem of ordering - since you have the same z-order, same z-level ordering is dependent on order of declaration. Loader will create an Item which is on the same z-level as the MouseArea - but moving the Loader to be declared after the MouseArea ensures that it's MouseArea is on top and will get the Mouse events.
Alternatively you could be explicit about the z-level ordering by using the 'z' property of Item's with
Loader { id: pageLoader; z: 1 }
Cheers,
Henrik
On Mar 29, 2010, at 11:19 AM, ext Matthew A wrote:
** 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!
<ATT00001..txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100329/20a44714/attachment.html
More information about the Qt-qml
mailing list