Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Windows Tree View

    General and Desktop
    3
    3
    749
    Loading More Posts
    • 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.
    • S
      samdol last edited by

      alt text

      I made a treeView/QFileSystemModel to show directory structure.
      When I set root index as following,
      QTreeView *treeView = new QTreeView(this);
      treeView->setRootIndex(treeView->model()->index(-1,-1));
      it show only drive letters as you can see the left hand side of attached
      picture.
      Does anyone know how I show the directory structure like the right hand side of picture?
      Thank you.

      jsulm raven-worx 2 Replies Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @samdol last edited by

        @samdol

        Did you try http://doc.qt.io/qt-5.7/qtreeview.html#setExpanded ?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 2
        • raven-worx
          raven-worx Moderators @samdol last edited by

          @samdol
          thats not possible directly, since they are "Windows specific".
          You can create a custom proxy model (around the QFileSystemModel) and insert them yourself.
          But i don't know if the exact same view is even achievable.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply Reply Quote 2
          • First post
            Last post