Commit 0f0f7f1d authored by hjk's avatar hjk

TreeModel: Fix tree level item iteration

If the first descend did not hit the desired level the iterator
was backing one level too much and failed to visit some items.

Change-Id: Ia0f48a101a9daa0ad9359d081fe1949009ba6e19
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 0bf1c85b
......@@ -154,13 +154,13 @@ public:
QTC_ASSERT(m_depth < m_level, return);
do {
TreeItem *curr = m_item[m_depth];
++m_depth;
int size = curr->rowCount();
if (size == 0) {
// This is a dead end not reaching to the desired level.
goUpNextDown();
return;
}
++m_depth;
m_size[m_depth] = size;
m_pos[m_depth] = 0;
m_item[m_depth] = curr->child(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment