Important: Please read the Qt Code of Conduct -

QListView/QFileSystemModel:Change directory.

  • Hi, All,
    I am coding for a simple project similar with files manager. I use a QListView to show and manipulate the folders and files. The model of the QListView is QFileSystemModel. The following codes are used to change the directory.

    if (m_pFileSystemModel->isDir(Index))


    These codes are put in a slot connected with the double click signal. I can change the normal directory with these codes. But, when I double click the folders "." and "..", all the folders are disappeared.
    The filter for the QFileSystem is

    m_pFileSystemModel->setFilter( QDir::AllDirs|QDir::AllEntries);

    Could anyone help me in this case.

    Thank you.

Log in to reply