Pseudo code:
for i = rowCount() - 1 to 0:
push index( i, 0 )
while stack not empty:
pop idx from stack
process idx
if hasChildren( idx ):
for i = rowCount( idx ) - 1 to 0:
push index( i, 0, idx )
for i = rowCount() - 1 to 0:
push index( i, 0 )
while stack not empty:
pop idx from stack
process idx
if hasChildren( idx ):
for i = rowCount( idx ) - 1 to 0:
push index( i, 0, idx )
To copy to clipboard, switch view to plain text mode
(this code assumes that you keep items as rows and columns just represent their properties)
Bookmarks