setRootPath(sPath); tre" /> setRootPath(sPath); tre" /> setRootPath(sPath); tre"/>

How to change file icons in QFileSystemModel

104 Views Asked by At

I have a code:

QExplorer::QExplorer(QWidget *parent)
{
    QString sPath = "D:/";
    dirmodel = new QFileSystemModel(this);
    dirmodel->setRootPath(sPath);
    treeView = new QTreeView(this);
    treeView->setModel(dirmodel);
    treeView->setRootIndex(dirmodel->index(sPath));
} 

Now my icons looks like this:
enter image description here

But I want them to look like this:
enter image description here
How can I change file's and folder's icons?

0

There are 0 best solutions below