Table of Contents

All about lists

The following text is taken verbatim from the source slides1) including any errors in the code examples.

Models in QtQuick

ListModel {
  ListElement {
    picture: "images/user_1.png"
    name: "Adriel"
    surname: "Nunes Teles"
    telephone: "+1 347 715 3354"
    favorite: true
    icon: "sms"
  }
}

ListView

...
Text {
  id: nameTxt
  font.family: "Univers LT Std"
  color: "#c8c8c8"
  font.pixelSize: 22
  text: "<b>Adriel</b> Nunes Teles"
  anchors.left: icon.right
  anchors.top: icon.top
  anchors.topMargin: 8
}
...
...
property string intern_name
property string intern_surname
property string intern_telephone
...
}
Text {
  id: nameTxt
  font.family: "Univers LT Std"
  color: "#c8c8c8"
  font.pixelSize: 22
  text: "<b>"+ intern_name + "</b> " + intern_surname
  anchors.left: icon.right
  anchors.top: icon.top
  anchors.topMargin: 8
}
...
ListView {
  id: listExample
  orientation: "Vertical"
  model: ListModelExample {}
  delegate: itemComponent
}
Component {
  id: itemComponent
  ListItemExample {
    intern_name: model.name
    intern_surname: model.surname
    intern_telephone: model.telephone
    intern_icon: model.icon
  }
}
...

GridView

JavaScript and ListModel

Animating list items


Resources