So, let's say i have this on a file:

#include "MyFolder1\MyFile1.txt"
#include "MyFolder1\MyFolder1SubFolder\MySubFile1.txt"
#include "MyFolder2\MyFolder2Sub\MyFolder3Sub\MySubFile1.txt"

What i'm trying to do is to make a project tree, it's well explained on the sample up there. But the issue is, should i be using QTreeWidget or QTreeView for it?
But that's not actually the major issue, i don't know (Well, i do have an idea, but it may not be the best) to exactly do it. My way is splitting the stuff for each "\". But i think that would be really a mess.

What's the most effective way to do this?

First, unless you are going to limit yourself to Windows systems, don't use backslashes () for directory separators. Use a forward slash (/) instead. Windows will handle that just fine, but the backslash has special meaning in C/C++ programs and it won't work if you want to compile your code in Linux/Unix/OSX, et al.

As for QTreeWidget or QTreeView, it depends upon what you need to do. I assume you are using QT for your UI needs. You really need to first create an abstract tree structure that is not directly aligned with any particular GUI tool set. Then, once you have the tree built that represents the structure as it is, you can use QT, GTK, Wx, or whatever to render it on the display.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.