Significance of the row parameter in QTreeView::setRowHidden
-
QTreeViewhas asetRowHiddenmember function. The function takes three arguments. While the second (parentQModelIndex) and the third (a boolean) are easy to understand, what does theint rowparameter signify? In a tree, the rows cannot be numbered linearly trivially, doesrowimply the insertion order in which it was inserted to some parent? Or something else? -
QTreeViewhas asetRowHiddenmember function. The function takes three arguments. While the second (parentQModelIndex) and the third (a boolean) are easy to understand, what does theint rowparameter signify? In a tree, the rows cannot be numbered linearly trivially, doesrowimply the insertion order in which it was inserted to some parent? Or something else?@ajaxcrypto Hi,friend. Welcome.
In the
QTreeView, when we userow, we should give therow's parent index. about this, the model/view programming. InBasic conceptssection. It tell different inQListViewQTableViewQTreeView. It will help you better than me. -
So
rowsignifies the order in which the row was inserted/added for the given parent. -
So
rowsignifies the order in which the row was inserted/added for the given parent.@ajaxcrypto
No, it seems to me the http://doc.qt.io/qt-4.8/model-view-programming.html#basic-concepts link @joeQ gave you shows in the diagram what therowdefinition is for a Tree Model. Did you look at it?To be clear, it is the current order of children at each level, not the order they were added --- although those two might be the same if all you do is append, you can also do inserts into the middle of the children, or deletes, which will change the row numbering.
-
Well yes, the model will not be inserting, only appending rows so in my case, it matches the insertion order. You are completely correct however.