Overlapping QML
-
import QtQuick 1.0
Rectangle {
width: choose_chiuaua.width; height: choose_chiuaua.heightLoader {
id: mainLoader
anchors.fill: parentMouseArea {
id: cchoose2menu
x: 162
y: 272
width: 78
height: 44
onClicked: {mainLoader.source = "menu.qml";}
}MouseArea {
id: cchoose2name
x: 0
y: 272
width: 78
height: 44
onClicked: {mainLoader.source = "naming_pet.qml";}
}MouseArea {
id: chiuaua_next
x: 191
y: 178
width: 43
height: 44
onClicked: {mainLoader.source = "choose2shitzu.qml";}}
MouseArea {
id: chiuaua_back
x: 12
y: 179
width: 43
height: 44
onClicked: {mainLoader.source = "choose2aspin.qml";}}
AnimatedImage { id: choose_chiuaua; x: 0; y: 0; width: 240; height: 316;
source: "Choose Pet (Chiuaua)" } // GIF FILE
}
}@@// choose2aspin.qml
import QtQuick 1.0
Rectangle {
width: choose_aspin.width; height: choose_aspin.heightLoader {
id: mainLoader
anchors.fill: parentMouseArea {
id: achoose2menu
x: 162
y: 272
width: 78
height: 44
onClicked: {mainLoader.source = "menu.qml";}
}MouseArea {
id: achoose2name
x: 0
y: 272
width: 78
height: 44
onClicked: {mainLoader.source = "naming_pet.qml";}
}MouseArea {
id: aspin_next
x: 191
y: 178
width: 43
height: 44
onClicked: {mainLoader.source = "choose2chiuaua.qml";}
}MouseArea {
id: aspin_back
x: 12
y: 179
width: 43
height: 44
onClicked: {mainLoader.source = "choose2shitzu.qml";}}
AnimatedImage { id: choose_aspin; x: 0; y: 0; width: 240; height: 316;
source: "Choose Pet (Aspin)" } //GIF FILE
}
}
@import QtQuick 1.0
Rectangle {
width: choose_shitzu.width; height: choose_shitzu.heightLoader {
id: mainLoader
anchors.fill: parentMouseArea {
id: schoose2menu
x: 162
y: 272
width: 78
height: 44
onClicked: {mainLoader.source = "menu.qml";}
}MouseArea {
id: schoose2name
x: 0
y: 272
width: 78
height: 44
onClicked: {mainLoader.source = "naming_pet.qml";}
}MouseArea {
id: shitzu_next
x: 191
y: 178
width: 43
height: 44
onClicked: {mainLoader.source = "choose2aspin.qml";}}
MouseArea {
id: shitzu_back
x: 12
y: 179
width: 43
height: 44
onClicked: {mainLoader.source = "choose2chiuaua.qml";}}
AnimatedImage { id: choose_shitzu; x: 0; y: 0; width: 240; height: 316;
source: "Choose Pet (Shih Tzu)" }}
}
@Hi to all!
Here are some of my codes in QML. Its working and the MouseArea(s) are working too. But the thing is, its only overlapping the previous QML and the previous MouseArea(s) is still in the new called QML.
Please help me. Thanks in Advance
EDIT: moved to forum Qt Quick, Gerolf
-
[quote author="eirnanG" date="1308715713"]@ //choose2chiuaua.qml
Here are some of my codes in QML. Its working and the MouseArea(s) are working too. But the thing is, its only overlapping the previous QML and the previous MouseArea(s) is still in the new called QML.
Please help me. Thanks in Advance[/quote]
Your previous MoseArea(s) will still be active as your are not making then invisible or reducing the size to zero.
@http://doc.qt.nokia.com/4.7-snapshot/qml-loader.html#source-prop@
According to the doc, setting new source should unload previous item and load the new one. If this does not happen then its a bug.}
-
you are welcome. So only thing you did was making MouseArea disabled when you don't need them?