I am using QFileSystemModel to represent file structure through the QTreeView. Everything works fine and it displays C:, D: etc drives in TreeView, but I need to add an additional row at the beginning of the tree. For example for now is:

+ C:
+ D:
+ E:

After adding the row ‘Local Drives’ at the beginning, I wanna display it like:
Qt Code:
  1. - Local Drive
  2. + C:
  3. + D:
  4. + E:
To copy to clipboard, switch view to plain text mode 
Here is the code:
Qt Code:
  1. pSystemPrimaryModel = new QFileSystemModel(this);
  2. pSystemPrimaryModel->setRootPath(QDir::currentPath());
  3. ui->TreeView->setModel(pSystemPrimaryModel);
To copy to clipboard, switch view to plain text mode