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. how can i see the content of a directory?

how can i see the content of a directory?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 545 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have a listview and I want to see the content of the directory, I wrote:

    (_listView->model()->data(index.child())*/
    

    but I have errors because I have many children and not only one, so how must I write?

    1 Reply Last reply
    -1
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Please reread your post and think about how anyone should help you with the information you provided...

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      ? 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        Please reread your post and think about how anyone should help you with the information you provided...

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @Christian-Ehrlicher I know but information are only these..I have some directories in a listview and I must analyze its content

        ? 1 Reply Last reply
        0
        • ? A Former User

          @Christian-Ehrlicher I know but information are only these..I have some directories in a listview and I must analyze its content

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @vale88 if I write:

          QVariant data_child = _listView->model()->data(index.child());
          
          

          I have problems because I have more children

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

            Hi,

            What problem is that ?
            What analysis do you want to make ?
            At what level ?
            On what kind of filesystem ?

            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
            1
            • SGaistS SGaist

              Hi,

              What problem is that ?
              What analysis do you want to make ?
              At what level ?
              On what kind of filesystem ?

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              @SGaist to see children I wrote:

               int numero_children = _listView->children().count();
                              QList<QString> list;
              
                              for (int i=0; i<numero_children; i++)
                              {
              
                              QVariant data_child = _listView->model()->data(index.child(i,0));
                              list.insert(i,data_child.toString());
              
                            }
              but data_child results empty but I have children
              
              ? 1 Reply Last reply
              0
              • ? A Former User

                @SGaist to see children I wrote:

                 int numero_children = _listView->children().count();
                                QList<QString> list;
                
                                for (int i=0; i<numero_children; i++)
                                {
                
                                QVariant data_child = _listView->model()->data(index.child(i,0));
                                list.insert(i,data_child.toString());
                
                              }
                but data_child results empty but I have children
                
                ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                @vale88 inside the dir I have:
                0_1560238506034_Cattura.PNG

                but I see seven children because I see also children inside dir Nuova Cartella, but if I want to see only these four children how must I write?

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

                  So you are using a QFileSystemModel ?

                  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

                  • Login

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