0

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?

why
  • 31
  • 5
  • 3
    Have a look at [`QFileSystemModel::setIconProvider `](https://doc.qt.io/qt-6/qfilesystemmodel.html#setIconProvider). – G.M. Jun 22 '23 at 17:50

0 Answers0