Important: Please read the Qt Code of Conduct -

Reorder Item childrens

  • 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


    Column {
        id: container


    Item {
         anchors.horizontalCenter: parent.horizontalCenter // Warn here
    JS file

    var items = [];
    var obj = component.createObject(container, properties);
    container.children = items; // Warn

Log in to reply