Advanced Qt - A Deep Dive 6/6 - ModelView Part 2
summary
Shows how to implement a scalable on‑demand tree model by subclassing QAbstractItemModel to wrap an existing QObject hierarchy (an object inspector example), using createIndex/internalPointer to store item pointers, and implementing index and parent methods correctly (rowCount/columnCount/data too). Covers persistent vs transient QModelIndex, a model_test utility, and practical proxy models (filter, sort, flip, colorize) with pitfalls. Demonstrates nonblocking loading via worker threads but requires emitting change notifications from the main thread.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:47Tree Models
- 2:30Models
- 8:35Model Indexes
- 16:10Why you shouldnt keep Model Indexes
- 17:15Example
- 17:50User Interface
- 20:31Demonstration
- 21:49Code Generator
- 25:19Column Count
- 28:17Row count
- 31:39Dialogue
- 34:49Review
related talks
02h 16mWORKSHOP: Back to Basics: writing a model
25mBest Practices for using QML and QtQuick
28mImplementing Modern Design Patterns with Qt
20mHow to push the most performance possible out of Qt applications
49mHow to scale QML based projects an Architecture vision
38mLazy QObject tree traversal
30mThe building blocks of QML, and how to use it with C++
01h 29mValue-oriented design in an object-oriented system
