Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileSystemModel populates QTreeView with all drives in system when only given C:/ drive as rootpath
Forum Updated to NodeBB v4.3 + New Features

QFileSystemModel populates QTreeView with all drives in system when only given C:/ drive as rootpath

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 271 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.
  • fcarneyF Offline
    fcarneyF Offline
    fcarney
    wrote on last edited by
    #1

    I have been trying to understand how the QFileSystemModel works. In the demo "dirview" I can set the root path (setRootPath) to "C:/" and the view shows all the drives in the system, not just the C drive. It also updates when drive is added or removed. I am unclear what I signals I need to connect to in my own code. I am using my own view in QML. Looking through the documentation of QAbstractItemModel it is not clear to me what signals are needed for a basic view. All of them? So far my objects look at the index and populates what is below that index. I am unclear as to how to see all the drives using this method.

    C++ is a perfectly valid school of magic.

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      I think I found what I needed: https://www.qtdeveloperdays.com/sites/default/files/north-america/QtQuickTreeView.pdf

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      1

      • Login

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