Hi. I am writing a simple file manager in C ++ and Qt as an exam assignment. QFileSystemModel is displayed in the QListView as text strings, without folder and file icons. I have the following code:

Qt Code:
  1. ui->setupUi(this);
  2. model_Main = new QFileSystemModel(this);
  3. model_Main->setFilter(QDir::QDir::AllEntries);
  4. model_Main->setRootPath("");
  5. MyIconProvider = new QFileIconProvider();
  6. MyIconProvider->setOptions(QFileIconProvider::DontUseCustomDirectoryIcons);
  7. model_Main->setIconProvider(MyIconProvider);
  8. ui->listViewMain->setModel(model_Main);
To copy to clipboard, switch view to plain text mode 

This QFileIconProvider works on Windows 10 (folder and file icons are displayed as default in QListView), but does not work on MacOS 10.14 and 11.4 (The icons are not displayed by default. It is possible to check only on these versions). What needs to be done to make the code work on MacOS?