The main qml page is as follows:
Page{
id: mainPage
EmbeddedPage{ // this is the embedded page
}
DropDown{
id: dropDown
Option{
text: "1"
value: text
}
Option{
text: "2"
value: text
}
onSelectedOptionChanged: {
updateEmbPage();
}
}
function updateEmbPage(){
var page = embPage.createObject();
page.valueNo = dropDown.selectedValue;
}
attachedObjects: [
ComponentDefinition{
id: embPage
source: "asset:///EmbeddedPage.qml"
}
]
}
The qml for the EmbeddedPage is as follows:
Container{
property int valueNo
Label{
text: valueNo
}
}
Now, I want the label text of the EmbeddedPage
to change according to the option selected in the dropDown
and my method does not work. So, please provide me with a solution. Thanks.