~/talk

WORKSHOP: Back to Basics: writing a model

Talkat QtDay 2020 · 2020-11-16..11-19· [software-architecture]
links:none on file
slides:none on file

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

  1. 0:00Start
  2. 11:54What is a model?
  3. 29:48What kind of structured data can you use?
  4. 33:41QModelindex(): bootstrapping navigation
  5. 40:13QModelindex: caveats
  6. 42:42Data Roles
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.