I have a width
property on a QML Rectangle
that is set based on another Rectangle with an id of mainwindow
and one of the array properties of mainwindow
:
width: mainwindow.width/mainwindow.numColsPerRow[positionRow]
This works at the time my rectangle is setup; that is, the element inside the array numColsPerRow
is correctly involved.
However, after this Rectangle is setup, if I change the values inside numColsPerRow
the width
of this Rectangle does not have any effect.
Does QML not allow property bindings to array elements?
Model
to store dynamic data that you want your items to bind to. – koopajahvariant
however if you use your arrays asvar
instead, the notion that you cannot modify the array elements directly doesn't apply.variant
is obsolete in favor of ordinary javascriptvar
, though this still doesn't address the binding issue. – johnbakersListModel
for this – koopajah