English
Summary
Conclusions
A model is a contract between the data and the view. Correct roles, indexes, and signals are just as important as the correct number in a cell. A dialog confirms prepared data, a proxy changes its visibility, and a transaction ensures consistent saving. Separating responsibilities lets you test these mechanisms independently.
Self-check questions
- How does Model/View differ from storing items in a QTableWidget?
- Which methods are required for a flat table model?
- Why does an invalid parent denote the root of a table?
- How do DisplayRole and EditRole differ?
- What must happen after a successful setData?
- What is the order of actions when adding or removing a row?
- Why is a reset unnecessary when changing a single cell?
- How do literal and regular expression filters differ?
- Why is mapToSource needed before removal?
- Which methods does a custom delegate implement?
- How does open differ from exec for a dialog?
- What does QFileDialog return after Cancel?
- Why does OnManualSubmit not replace a transaction?
- When is it safe to close and remove an SQL connection?
- What are the advantages of a repository outside Qt?