QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
We begin our application by defining a ListView, a model which will provide data to the view, and a delegate which provides a template for constructing items in the view.
The code for the ListView and delegate looks like this:
The model is defined in a separate QML file which looks like this:
Walkthrough
The first item defined within the application's root Rectangle is the delegate Component. This is the template from which each item in the ListView is constructed.
The name, age, type, and size variables referenced in the delegate are sourced from the model data. The names correspond to roles defined in the model.
The second part of the application is the ListView itself to which we bind the model and delegate.