I have a ListModel:
ListModel {
ListElement {
property: "value"
}
ListElement {
property: "value2"
}
}
which I am trying to access from a c++ Qt class.
I've managed to get a reference to the listmodel:
QQmlEngine engine;
QQmlComponent component(&engine,
QUrl("qrc:///path.qml"));
QObject *object = component.create();
Debbuging the object gives me a QQmlListModel(adress)
.
object -> chlidren()
gives me nothing, object -> children().count()
shows 0.
I tried making a QList
or QTableView
from the object
, but with no luck.
How can I get the values of the ListElements ?