Solved Significance of the row parameter in QTreeView::setRowHidden
-
QTreeView
has asetRowHidden
member function. The function takes three arguments. While the second (parentQModelIndex
) and the third (a boolean) are easy to understand, what does theint row
parameter signify? In a tree, the rows cannot be numbered linearly trivially, doesrow
imply 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 concepts
section. It tell different inQListView
QTableView
QTreeView
. It will help you better than me. -
So
row
signifies 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 therow
definition 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.