It appears that QDirModel uses rows to store directory entries, which means that columns are not useful at all. So I have a simple hierarchy:
If I run the following code to browse the hierarchy:Code:
ls -R A C ./A: B ./A/B: ./C:
I get the expected output:Code:
void { for (int i=indent ; i>0 ; i--) this->Print(" \r"); this->Print("%d %d %s", idx.row(), idx.column(), info.fileName().toAscii().constData()); for (int i=0 ; idx.child(i, 0).isValid() ; i++) this->ComputeSizes(idx.child(i, 0), indent+2); }
But if I change the code so as to browse columns rather that rows as follow:Code:
MyClass: 38 0 test MyClass: 0 0 A MyClass: 0 0 B MyClass: 1 0 C
I get an unexpected output:Code:
void { for (int i=indent ; i>0 ; i--) this->Print(" \r"); this->Print("%d %d %s", idx.row(), idx.column(), info.fileName().toAscii().constData()); for (int i=0 ; idx.child(0, i).isValid() ; i++) this->ComputeSizes(idx.child(0, i), indent+2); }
I would have expected that idx.child(0, i>0) be unvalid!Code:
MyClass: 38 0 test MyClass: 0 0 A MyClass: 0 0 B MyClass: 0 1 B MyClass: 0 2 B MyClass: 0 3 B MyClass: 0 1 A MyClass: 0 2 A MyClass: 0 3 A
I have one more question: what is the difference between QDirModel::sibling() and QDirModel::child()?