I want to pass signal from one qml file to another qml file. So that when it gets the signal I can make another file visible Here is my main.qml
import QtQuick 1.1
Rectangle{
id:main
width:480
height:272
gradient: Gradient {
GradientStop { position: 0.0; color: "light blue" }
GradientStop { position: 1.0; color: "blue" }
}
Welcome{
id:welcomePage
width:parent.width
height:parent.height
visible:true
}
LoginPage{
id:login
width:parent.width
height:parent.height
visible:false
}
Connections{
ignoreUnknownSignals: true
onsigLogin:{welcomePage.visible=false
login.visible=true
}
}
}
here goes my welcome.qml
import QtQuick 1.1
Rectangle{
id:welcome
width:480
height:272
signal sigLogin()
gradient: Gradient {
GradientStop { position: 0.0; color: "light blue" }
GradientStop { position: 1.0; color: "blue" }
}
Text{
text:"\n\t\tPRESS ENTER"
font.bold:true
font.pointSize: 17
}
Button {
id: wel
height:30;
x:parent.width/2-30
y:parent.height/2-30
focus:true
border.color:"black"
opacity: activeFocus ? 1.0 : 0.5
Text{
text:"WELCOME"
anchors.horizontalCenter:wel.horizontalCenter;
anchors.verticalCenter:wel.verticalCenter;
}
Keys.onReturnPressed: {
wel.focus=false
welcome.sigLogin()
}
}
}
When I run this I get the following error
file:///home/sakshi/try1/main.qml:24:9: Cannot assign to non-existent property "onsigLogin"
onsigLogin:{welcomePage.visible=false
^
Can any one suggest me how to pass signal from one file and how to make changes when I get that signal?