Thank you for your response anda_skoa and wysota.
After I changed either the active or source property only the header of anotherfile.qml being displayed, the same thing happened when loader unloaded the loaded item, only the header of mainfile.qml was displayed.
//mainfile.qml
ColumnLayout
{
Rectangle
{
id: header
height: 90
Layout.fillWidth: true
color: "#000000"
anchors.top: parent.top
Text {}
}
//contents of the page
ColumnLayout
{
id:body
clip: true
Flickable
{
anchors.fill: parent
interactive: false
Rectangle
{
id: background
color: "#00000000"
Layout.fillWidth: true
anchors {
fill: parent
topMargin: 10
}
}
}
}
Loader
{
id: loader
anchors.fill: parent
}
}
//mainfile.qml
ColumnLayout
{
Rectangle
{
id: header
height: 90
Layout.fillWidth: true
color: "#000000"
anchors.top: parent.top
Text {}
}
//contents of the page
ColumnLayout
{
id:body
clip: true
Flickable
{
anchors.fill: parent
interactive: false
Rectangle
{
id: background
color: "#00000000"
Layout.fillWidth: true
anchors {
fill: parent
topMargin: 10
}
}
}
}
Loader
{
id: loader
anchors.fill: parent
}
}
To copy to clipboard, switch view to plain text mode
//anotherfile.qml
ColumnLayout
{
Rectangle
{
id: header
height: 90
Layout.fillWidth: true
color: "#000000"
anchors.top: parent.top
Text{}
}
//contents of the page
ColumnLayout
{
id:body
clip: true
Rectangle
{
id: background
Layout.fillWidth: true
color: "#00000000"
anchors.fill: parent
}
}
MouseArea
{
id: mouseArea
anchors.fill: parent
onClicked: { loader.source = "" }
}
}
//anotherfile.qml
ColumnLayout
{
Rectangle
{
id: header
height: 90
Layout.fillWidth: true
color: "#000000"
anchors.top: parent.top
Text{}
}
//contents of the page
ColumnLayout
{
id:body
clip: true
Rectangle
{
id: background
Layout.fillWidth: true
color: "#00000000"
anchors.fill: parent
}
}
MouseArea
{
id: mouseArea
anchors.fill: parent
onClicked: { loader.source = "" }
}
}
To copy to clipboard, switch view to plain text mode
Am I missing something or am I doing it wrong?
Please advise. Thanks!
Bookmarks