Invisible root qmodelindex () is invalid
The parent parameter in the index function of list and table is as long as root qmodelindex, because there is no hierarchical concept
- Model indexes give views and delegates information on the location of items provided by models in a-to-be indepen Dent of any underlying data structures.
- Items are referred through their row and column numbers, and by the model index of their parent items.
- Model indexes is constructed by models at the request of all components, such as views and delegates.
- If a valid model index is specified for the parent item, the index is requested using index (), the index retur Ned refers to a item beneath that parent item in the model. The index obtained refers to a child of this item.
- If an Invalid model index was specified for the parent item, a index is requested using index (), the index re Turned refers to a top-level item in the model.
- The role distinguishes between the different kinds of data associated with an item.
- The dimensions of a model can be found using RowCount () and ColumnCount (). These functions generally require a parent model index to be specified.
- Model indexes is used to access items in the model. The row, column, and parent model index is needed to specify the item.
- To access top-level items in a model, specify a NULL model index as the parent index with Qmodelinde X ().
- Items contain data for different roles. To obtain the data for a particular role, both the model index and the role must being supplied to the model.
QT Model View Programming summary