Skip to content
Kimmo edited this page May 17, 2018 · 9 revisions

Basic Delegate (P0 | 1h)

Explanation of the contents of a topic page @ Topic reference page

Back to Week 3

Objective: OBJECTIVE

Tino: Rendering and editing model data

Beginner

  • What is the model/view pattern? (3.00)

Intermediate

  • What is a delegate?
  • When are delegates used?
  • How do delegates relate to the model/view pattern?
  • How is data provided to the delegate?
  • What views are available to delegates?
  • How to modify data from the delegate*
  • What is QAbstractItemDelegate?
  • What is QItemDelegate?

Tino: Please drop the latter two ones. Lets try to concentrate on QML as much as possible not to confuse the students.

Tino: Attached properties. This is very important. How to use the attached properties, provided by views to delegates? They are visible to the root of the delegate only, so this is also important thing to mention. There could be trivial examples, such as currentItem but also Path attributes in the path view provides visually nice examples.

K: Attached properties are ListView.delayRemove, ListView.isCurrentItem, ListView.view and ListView.section stuff

Expert

Omitted


Course material content

Instructions and description for the exercise of the topic

Basic delegates


Exhaustive reference material mentioned in this topic

http://doc.qt.io/qt-5/model-view-programming.html
https://qmlbook.github.io/en/ch06/index.html#delegate
https://www.quora.com/What-are-delegates-in-Qt
https://doc.qt.io/archives/qq/qq24-delegates.html
http://doc.qt.io/qt-5/qitemdelegate.html
https://www.ics.com/designpatterns/book/delegates.html
http://doc.qt.io/archives/qt-4.8/qabstractitemdelegate.html#details
http://doc.qt.io/qt-5/qitemdelegate.html#details

Further reading topics/links:

Clone this wiki locally