Reorder Item childrens
Unsolved
QML and Qt Quick
-
I am creating childs dynamically using createObject and to reorder them I use this code
container.children = sorted_objects
but QML warn TypeError: Cannot read property of null on each reference to parent.
I know I can use a Repeater for this purpose but a Loader takes a Component not an object.
-
Hi! Can you show us some code?
-
Basically
Main.qml
Column { id: container }
Component.qml
Item { anchors.horizontalCenter: parent.horizontalCenter // Warn here } JS file
var items = [];
var obj = component.createObject(container, properties);
items.push(obj);
items.sort();
container.children = items; // Warn