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. Is there a way to add files and visualize them in QTreeView?
Forum Update on Monday, May 27th 2025

Is there a way to add files and visualize them in QTreeView?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 472 Views
  • 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.
  • D Offline
    D Offline
    DoubleC122
    wrote on last edited by
    #1

    Hi. I'd like to know if it is possible to add "files" (as strings) that technically are not present in the filesystem and visualize them in a QTreeView, maybe without using a QFileSystemModel?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If not "technically" in the file system, where are they located ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DoubleC122
        wrote on last edited by
        #3

        Well, I'm not talking about files as in real files, but just as items in the QTreeView that are not from a QFileSystemModel, pretty much as one would fill a QListView with some strings.

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          Sure, QStandardItemModel can build generic trees that can be displayed inside QTreeView

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          3
          • D Offline
            D Offline
            DoubleC122
            wrote on last edited by
            #5

            Oh thank you, that is what I needed.

            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