Unsolved GridView: Getting the visual index position of all delegates
-
Hi,
I have a
DelegateModel
of several objects arranged in aGridView
. The object has been generated in c++ from aQList<QObject*>
viaQVariant::fromValue(_programList)
The items can be rearranged on the screen via drag and drop. If a rearranging occurs, I need to send a list of the positions of the respective items to the c++ side. How can I get the position in the grid view from the model in qml? So I have
GridView { id: gridView model: myModel delegate: myButton {}
and I don't know, how I can access the single delegate items via model, also I don't know how to access the gridview-position inside myButton.
-
Ok, for a
DelegateModel
this seems to be the way:var myob =gridView.model.items.get(i).model