Hello,
I have an C++ based application which exposed QAbstractmodel to QML file as data model.I want to get the Qmodelindex from list view. so that why i set c++ model as visualdata model & visual data model as listmodel as following
ListView
{
id: listView
anchors.fill: parent
model:VisualDataModel
{
model: cppModel //cppModel is model exposed from c++ file
delegate: petDelegate
}
}
after that i want to get model index & pass it to c++. for that i write code as..
mainView.somesignal(listView.model.modelIndex(index))
but when i print modelindex’s value it print as: QVariant(QModelIndex)
So How can get the value of model index in QML??
Edit: please wrap your code snippets with @ tags; Andre
↧