Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Qt Creator : How to list files and directories to Tree widget which placed in a stacked widget page

[SOLVED] Qt Creator : How to list files and directories to Tree widget which placed in a stacked widget page

Scheduled Pinned Locked Moved Mobile and Embedded
qtcreatorqt5.2.1qtreewidgetdirectoryfile navigation
4 Posts 2 Posters 6.2k 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.
  • A Offline
    A Offline
    Ajith_P_V
    wrote on 24 Aug 2015, 13:03 last edited by Ajith_P_V
    #1

    Hi all,
    I'm a newbie to the Qt creator. I'm using Qt creator version 3.0.1 (Based on Qt 5.2.1 (GCC 4.6.1, 64 bit)).
    Now come to my question. I'm writing an application which have multiple pages (stacked widget application). I wish to show folder list (folders and its files) in one of the page. So I chose "TreeWidget" for that purpose. But, I don't know how I can show the folder list in the TreeWidget that, placed in one of the page of the stacked widget.
    Could anyone please help me to solve this. It would be better if you can showcase this with an example or a code snippet.
    Looking forward to your reply...
    PS: I have tried some google-ing and experiment but nothing shows the directory list as I wish :(
    Thank you in advance,
    Ajith P V

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 Aug 2015, 13:34 last edited by
      #2

      Hi,

      Wouldn't a QTreeView + QFileSystemModel combo do the trick ?

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

      A 2 Replies Last reply 25 Aug 2015, 05:39
      1
      • S SGaist
        24 Aug 2015, 13:34

        Hi,

        Wouldn't a QTreeView + QFileSystemModel combo do the trick ?

        A Offline
        A Offline
        Ajith_P_V
        wrote on 25 Aug 2015, 05:39 last edited by
        #3

        @SGaist Thank you for your support. QTreeView + QFileSystemModel combo will surely do the trick. But, how I can call this one to show the directory list inside a stacked widget page? I'm pretty confused in this case.
        Please let me know how I can achieve the QTreeView + QFileSystemModel combo to show inside a stacked widget page.

        Thank you in advance,
        Ajith P V

        1 Reply Last reply
        0
        • S SGaist
          24 Aug 2015, 13:34

          Hi,

          Wouldn't a QTreeView + QFileSystemModel combo do the trick ?

          A Offline
          A Offline
          Ajith_P_V
          wrote on 25 Aug 2015, 06:05 last edited by
          #4

          @SGaist Thank you once again!
          Now, I can manage to display the folder list inside the stacked widget page using QTreeView + QFileSystemModel combo!

          1 Reply Last reply
          0

          1/4

          24 Aug 2015, 13:03

          • Login

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