Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QListView/QFileSystemModel:Change directory.
Qt 6.11 is out! See what's new in the release blog

QListView/QFileSystemModel:Change directory.

Scheduled Pinned Locked Moved Qt Creator and other tools
1 Posts 1 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fatseed
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved