Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

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

    General and Desktop
    3
    5
    195
    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.
    • D
      DoubleC122 last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • D
          DoubleC122 last edited by

          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 Reply Quote 0
          • VRonin
            VRonin last edited by

            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 Reply Quote 3
            • D
              DoubleC122 last edited by

              Oh thank you, that is what I needed.

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