0

I am dynamically trying to add Columns to my UI and then anchor them with the parent and nearby element, however parent is always null.

columns[i] = Qt.createComponent("Column.qml");

columns[i].createObject(rectangle1,{id : "column".concat(i), "anchors.left" : name, "width" :getcolwidth(rectangle1) });

Here anchors.left is column0 and in the Column.qml file, I have

anchors.leftMargin: 15
anchors.bottom:parent.bottom
anchors.bottomMargin: 5
anchors.top: parent.top
anchors.topMargin: 5

The parent should point to rectangle1 but instead it points to null.

HackToHell
  • 2,223
  • 5
  • 29
  • 44

0 Answers0