Ok...some progress...
Property bindings look like they will work fine for my purpose.
Issues:
When calling my javascript functions, why can I not access my QML objects? I get errors about the object being undefined. I've tried by using the alias for the object, the id for the object and the QML file name that houses the object....all give the same error.
AND... do I need to 'import' the parent and SubPages folders into each of my SubPages/*.qml files?
I ask because if I try to reference an object in SubPages/Page1.qml from SubPages/Page2.qml, I get an error about that object being undefined.
For instance, when I load SubPages/Page2.qml using the loader I showed earlier. Page2 has a Label that when clicked on will change a value on Page1. But, if I try this I get an error:
In Page2:
MouseArea {
anchors.bottom: parent.bottom
anchors.right: parent.right
Label {
id: page2Label
text: qsTr("ClickME")
horizontalAlignment: Text.AlignRight
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
font.pointSize: 24
color: "lime"
}
onClicked: {
Page1.page1Label.text = page2Label.text
Page1.page1Label.color = "lime"
page2Label.color = "darkred"
}
}
MouseArea {
anchors.bottom: parent.bottom
anchors.right: parent.right
Label {
id: page2Label
text: qsTr("ClickME")
horizontalAlignment: Text.AlignRight
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
font.pointSize: 24
color: "lime"
}
onClicked: {
Page1.page1Label.text = page2Label.text
Page1.page1Label.color = "lime"
page2Label.color = "darkred"
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks