QString fileName = "C:/aaa/bbb/something";QDirModel dm;QIcon icon = dm.fileIcon( dm.index( fileName ) );
C++ (Qt)QIcon icon = QFileIconProvider().icon( pathToFile );