Hello,
I have 3 .qml files pageloader.qml (first file) , A.qml and B.qml. I emit
signal from A and B on mouse action and which I am capturing in pageloader.
Both A and B have signals "signal aclicked()" and "signal bclicked()" which are
connected to onAclicked() and onBclicked() signal handlers respectively
implemented in pageloader.qml. Both the signals are working when other is
commented. But are not received successively.
//pageloader.qml
import Qt 4.7
Item {
width: 200
height: 200
Loader {
id:load
source: "A.qml"
B{
onBclicked:{
load.item.opacity = 0
console.log(load.source)
load.source = ""
console.log("B Clicked!")
console.log("B unloaded status !"+load.status)
load.source = "A.qml"
console.log(load.source)
console.log("A loaded status !"+load.status)
load.item.opacity = 1
}
}
A{
onAclicked:{
load.item.opacity = 0
console.log(load.source)
load.source = ""
console.log("A Clicked!")
console.log("A unloaded status !"+load.status)
load.source = "B.qml"
console.log(load.source)
console.log("B loaded status !"+load.status)
load.item.opacity = 1
}
}
}
}
//A.qml
import Qt 4.7
Rectangle {
id: rectangleA
width: 200
height: 200
color: "#0000ff"
signal aclicked()
Text {
x: 72
y: 67
width: 28
height: 48
text: "A"
font.bold: true
font.pointSize: 30
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea{
//id: areaA
anchors.bottomMargin: 0
anchors.topMargin: 0
anchors.leftMargin: 0
anchors.rightMargin: 0
anchors.fill: parent
Connections {
onClicked:{
console.log("A Clicked!")
rectangleA.aclicked()
}
}
}
}
}
//B.qml
import Qt 4.7
Rectangle {
id: rectangleB
width: 200
height: 200
color: "#ff0000"
signal bclicked()
Text {
x: 72
y: 67
width: 28
height: 48
text: "B"
font.bold: true
font.pointSize: 30
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea{
//id: areaB
anchors.bottomMargin: 0
anchors.topMargin: 0
anchors.leftMargin: 0
anchors.rightMargin: 0
anchors.fill: parent
Connections {
onClicked:{
console.log("B Clicked!")
rectangleB.bclicked()
}
}
}
}
}
>From the debug log I notice that
A Clicked!
file:///Z:/test_trans/A.qml
A Clicked!
A unloaded status !0
file:///Z:/test_trans/B.qml
B loaded status !1
B Clicked! ---->>>>>> signal is lost
Could someone correct me?
Thanks and Regards,
Rakesh
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml