In Listview, I have popping up 100's of items using "delegate", assume that, listview already displayed populated value. Now I would like to extract already displayed values in QML List view from C++. How to achieve this? Note: I can not access datamodel directly, since I am doing filtration in delegate using hidden variable
/*This is not working code, Please note,
delegate will not display all model data.*/
ListView
{
id:"listview"
model:datamodel
delegate:{
if(!hidden)
{
Text{
text:value
}
}
}
//Can I access by using given approach?
QObject * object = m_qmlengine->rootObjects().at(0)->findChild<QObject* >("listview");
//Find objects
const QListObject& lists = object->children();
//0 to count maximum
//read the first property
QVarient value = QQmlProperty::read(lists[0],"text");