I have complex structure of data and model to access to it.
Item (single value)
|
+-Item (single value)
|
+-Factory (single value)
| |
| +-Table (rows, columns)
|
+-Factory (single value)
|
+-Table (rows, columns)
Item (single value)
|
+-Item (single value)
|
+-Factory (single value)
| |
| +-Table (rows, columns)
|
+-Factory (single value)
|
+-Table (rows, columns)
To copy to clipboard, switch view to plain text mode
Elements of data stored in classes inherited from BaseItem class (in QModelIndex::internalPointer). To understand which implementation of BaseItem I have in current QModelIndex I use dynamic_cast<class name>.
I return correct rowCount and columnCount for each of structure elements, but on "Factory level" row of required row is -1 (in index method). Why view (I use QTreeView) asked for index of row -1?
P.S. Code is in attachment.
Bookmarks