Qt includes a Model View framework that maintains separation between the way data is organized and managed, and the way that it is presented to the user. In this section, we will learn how to make use of the model view, in particular by using the list view to display information and at the same time apply our own customization to make it look slick.
Create a new Qt Quick application project and open up
qml.qrc
with Qt Creator. Add six images,home.png
,map.png
,profile.png
,search.png
,settings.png
, andarrow.png
, to the project:After that, open up
MainForm.ui.qml
. Delete all the default widgets on the canvas and drag a List View widget from under the Qt Quick - Views category in the Library window onto the canvas. Then, set its Anchors setting to Fill the parent size by clicking on the button located in the middle of the Layout window:Next, switch over to the Script Editor, as we will define what the list view will look like:
After that...