I’m creating a Graph editor operating on a model in c++
I’m using a Repeater with a QQmlListProperty as its model:
Item {
id:contents
Repeater {
model: graph.modules
Node {
module: modelData
}
}
}
The nodes can be dragged around and connected to each other, but after adding another node to the list, all the positions and other properties get reset, and they will jumble up in the corner.
How can I avoid this? Do I have to implement my own repeater like class?
EDIT: I have looked at the source for repeater, and it appears that regenerate is called whenever the list is changed. Guess I’ll have to roll my own custom solution then…
Here’s the source, btw: https://qt.gitorious.org/qt/qtdeclarative/source/cad3ba5fd44c09455c2492548865a8743386ea18:src/quick/items/qquickrepeater.cpp
↧