Qt's Model/View separates data from presentation — but adds boilerplate. Learn when to switch from QListWidget to QAbstractListModel, how to layer QSortFilterProxyModel for live filtering, and the performance traps to avoid.
QStringListModel stores exactly what it shows. When your display format diverges from your data—like showing file names for full paths—you need a custom QAbstractItemModel. Here is how to implement the required functions and keep views synchronized.
Paginating a filtered Qt model breaks when you cache source indices. Page in proxy coordinates, clamp on structural signals, and decide where filtering lives.
An architecture note for Qt model/view UIs: keep the model on the GUI thread, reach it from workers only via queued signals, and treat begin/end insert pairing as a hard invariant.
Build a thread-safe Qt list model by subclassing QAbstractListModel, exposing it to QML, and marshaling background updates via queued signals. Covers required virtuals, editable roles, structural change signals, and common pitfalls.
Rebuilding a Qt model on every keystroke drops selection and stutters. Put QSortFilterProxyModel between model and view instead — setup, signal contract, and trade-offs.