What is child1? How do you initialize this variable? And why are you iterating i from 2 and not from 0?
What is child1? How do you initialize this variable? And why are you iterating i from 2 and not from 0?
hakermania (4th May 2011)
The code is like this:
So, it starts from 2 in order to avoid the paths at 0 and 1 (which means the paths: ) . (current) and .. (one previous), because I actually read folders' names and I add them to parnt, then add parnt to list and list to treewidget...Qt Code:
QDir his_file; ......... child1->setText(0,his_file.dirName()); parnt->addChild(child1);To copy to clipboard, switch view to plain text mode
When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.
Why don't you ask QDir to skip those special entries then?
hakermania (4th May 2011)
Thx for the suggestion but my solution at that point works perfectly and there's no point in changing it right now.
In the point now, I don't now what the point(problem) is xD
When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.
I think there is a point in changing it right now, because due to increased complexity of your code you can't be sure it is not the value of "i" that is causing the problem.
hakermania (4th May 2011)
Bookmarks