I have multiple QML files. I just want to link them. Then I want to return to my home page from every page I navigate to. I am using loader in every page Here is my code.
import QtQuick 1.1
Rectangle{
id:welcome
width:480
height:272
Loader{
id:loader
focus:false
anchors.fill: parent
}
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
loader.focus=true;
anchors.fill=parent
loader.source="Home.qml";
//welcome.visible=false;
}
}
}
My question is whenever I click on the button its loading new file. But the welcome page will not go. Both the file's will be overlapped. When I did visible=false complete UI will go. I get a white screen. Can any one help me fix this problem? How to load other file?