So, what i'm using is a QTreeWidget to make a File-Tree. I can easily create the files, and folders. But the issue comes when we talk about sub-folders. For example:
Folder1
Folder1/SubFolder1
Folder1/SubFolder1/SubFolder2
How do i exactly create the sub-folders? Here's my code to make the folders:
void Tree::addFolder(const QString &folderName)
{
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setText(0, folderName); // Sets the text.
m_projectItem->addChild(item); // Adds it to the main path. (It's a QTreeWidgetItem)
this->expandItem(item); // Expands.
}
Would i need to create another function (something like addSubFolder) to add folders inside another folders?