I have a listview in my homepage which has a custom listitem component. I have a value in my Qsettings variable which I can access in homepage but I'm unable to access the same inside the custom listitem component. When loading the homepage the Qsetting data log gets printed onCreationCompleted of homepage but shows error in onCreationCompleted of customlistitemhomepage. Below is a piece of sample code for my homepage structure and the customlistitemhomepage structure.
Page {
Container {
layout: DockLayout {
}
ScrollView {
id: homePageScroll
Container {
layout: DockLayout {
}
ListView {
id: contactListView
dataModel: contactsData
preferredHeight: homePageScroll.listHeight
overlapTouchPolicy: OverlapTouchPolicy.Allow
listItemComponents: [
ListItemComponent {
id: homeListComponent
type: "item"
CustomListItemHomePage {
id: listCell
}
//Some code
}
]
}
}
}
onCreationCompleted: {
console.log("Clipboard value:"+_settings.getValueFor("clipBoard", "No Data")); //THIS PRINTS CORRECTLY
}
}
}
I have also logged the same inside the CustomListItemHomePage.qml
CustomListItemHomePage {
onCreationCompleted: {
console.log("Clipboard value:"+_settings.getValueFor("clipBoard", "No Data")); //THIS SHOWS ERROR CAN'T Find variable _settings
}
}