Status Weekly Roundup: Desktop UI team.
19 Sep 2023, 14:24
Status Weekly Roundup: Desktop UI team
QML components consuming models (like ListView or Repeater) are very flexible about what that model is. It can be the most powerful C++ custom model inheriting from QAbstractItemModel, QML's handy ListModel, ObjectModel, or a plain JavaScript list.
However, this is not the end of the possibilities. For example, a list of QtObjects (or components that inherit from QtObject, like Item) can also be used as a model. This creates an interesting possibility of treating properties defined in objects as model roles.
Let's take a look at the example presented in
Using this approach, we can conveniently embed labels into objects in the StackLayout as read-only properties and use Repeater inside TabBar, as a model providing children of the StackLayout:
/ethstatus/status/1704139436068356152/photo/1
Thanks to that we don't have to maintain the correct order in two places (first for labels and later for corresponding objects in the layout).
#EthStatusProgress