In my TableView
I have ListModel
that is filled by user. I wanna save this model as a .csv file using python. But I can't send model via qml signal to pyqt (there is no type for models), and if I want to access this ListModel
in python using this line.
Python
model = self.engine.rootObjects()[0].findChild(QObject, "newCsvModel")
In return I get QAbstractListModel
, which (in my understanding) doesn't hold model content.
QML
This is how I use my model
TableView {
model: ListModel{
id: csvModel
objectName: "newCsvModel"
ListElement{
key1: "val1"
key2: "val2"
...
}
...
}
I have a class for sending the exact type of model from pyqt to qml and it works fine, but doing it the other way around is problematic for me. Do you know how extract data from qml ListModel?