Search code examples
qtqmlqtquick2qt-quick

Align horizontalcenter in Column


Column documentation explains how to achieve this:

enter image description here

However, I would like to achieve this:

enter image description here

That is, all items inside the Column should be horizontally aligned to the center. anchors.horizontalCenter: parent.Center does not work. How can I obtain the desired result?


Solution

  • I suppose you can use anchors.horizontalCenter for all the child items to align them with the horizontalCenter of the column given that the column has an id you can refer to.