WORKSHOP: Back to Basics: writing a model
summary
Workshop shows how to write a real Qt model: subclass QAbstractItemModel (or use QAbstractListModel), implement rowCount/data, handle roles via roleNames for QML, and avoid stuffing heavy I/O into data because views call data thousands of times. Use QModelIndex (or QPersistentModelIndex) correctly, call setData/emit dataChanged for edits, and wrap structural changes with beginInsertRows/endInsertRows. Tools demonstrated for debugging and testing: GammaRay inspector and QAbstractItemModelTester; profile before optimizing.
AI-written summary · about
chapters (6)
- 0:00Start
- 11:54What is a model?
- 29:48What kind of structured data can you use?
- 33:41QModelindex(): bootstrapping navigation
- 40:13QModelindex: caveats
- 42:42Data Roles
related talks
01h 21mAdvanced Qt - A Deep Dive 6/6 - ModelView Part 2
01h 01mAdvanced Qt - A Deep Dive 5/6 - ModelView Part 1
41mProgramming with Qt Quick 4/6 - Visual Elements Part 2
25mBest Practices for using QML and QtQuick
01h 00mProgramming with Qt Quick 1/6 - Meet Qt Quick Part 1
28mImplementing Modern Design Patterns with Qt
01h 19mGetting Started - a Qt fast track 4/4 - Application Creation
01h 17mGetting Started - a Qt fast track 2/4 - A Core Module
