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))
    {
    setRootIndex(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);
    m_pFileSystemModel->setNameFilters(strsFilter);
    m_pFileSystemModel->setNameFilterDisables(false);
    @

    Could anyone help me in this case.

    Thank you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.