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. Supporting data models for file lists
Forum Updated to NodeBB v4.3 + New Features

Supporting data models for file lists

Scheduled Pinned Locked Moved Unsolved General and Desktop
data modelsfile listssoftware designfile managementqfileinfo
9 Posts 4 Posters 1.9k Views 2 Watching
  • 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.
  • E Offline
    E Offline
    elfring
    wrote on last edited by
    #1

    A lot of software applications will usually work with file lists.
    The construction of customised data models can be performed by some design approaches then.

    I have got the impression that additional programming interfaces will be more helpful for this use case than a class like “QFileSystemModel”. QFileInfo objects can be combined into other data structures.

    Would you like to point any information sources out for reusable class libraries in this software area?

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

      It's not totally clear what you are trying to achieve. Do you want a QFileSystemModel that filters by extension type?

      "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

      E 1 Reply Last reply
      1
      • VRoninV VRonin

        It's not totally clear what you are trying to achieve. Do you want a QFileSystemModel that filters by extension type?

        E Offline
        E Offline
        elfring
        wrote on last edited by
        #3

        It's not totally clear what you are trying to achieve.

        This can be usual.

        Do you want a QFileSystemModel that filters by extension type?

        Such data processing can be also useful occasionally.

        But I am looking more for class libraries which will take care of the properties that are shared between files (and their names).

        Examples:

        • Case-insensitive iteration through file lists
        • Performing an action on each element in a list
        • Determination of directory hierarchies
        • Development challenges around the handling of symbolic links
        mrjjM VRoninV 2 Replies Last reply
        0
        • E elfring

          It's not totally clear what you are trying to achieve.

          This can be usual.

          Do you want a QFileSystemModel that filters by extension type?

          Such data processing can be also useful occasionally.

          But I am looking more for class libraries which will take care of the properties that are shared between files (and their names).

          Examples:

          • Case-insensitive iteration through file lists
          • Performing an action on each element in a list
          • Determination of directory hierarchies
          • Development challenges around the handling of symbolic links
          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @elfring
          Hi
          there is http://doc.qt.io/qt-5/qfileinfo.html
          for file handling.

          E 1 Reply Last reply
          0
          • mrjjM mrjj

            @elfring
            Hi
            there is http://doc.qt.io/qt-5/qfileinfo.html
            for file handling.

            E Offline
            E Offline
            elfring
            wrote on last edited by
            #5

            for file handling

            I mentioned the QFileInfo class already in my clarification request.
            I would appreciate if some comom file processing operations can be provided by a known class library (instead of repeating similar programming efforts).

            mrjjM 1 Reply Last reply
            0
            • E elfring

              for file handling

              I mentioned the QFileInfo class already in my clarification request.
              I would appreciate if some comom file processing operations can be provided by a known class library (instead of repeating similar programming efforts).

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @elfring
              well enumerating containers is covered by std so it would be few lines of code
              to have a list of QFileInfo and loop over them.
              Also Qt provides http://doc.qt.io/qt-5/qdiriterator.html
              to handle the directories.

              1 Reply Last reply
              1
              • E elfring

                It's not totally clear what you are trying to achieve.

                This can be usual.

                Do you want a QFileSystemModel that filters by extension type?

                Such data processing can be also useful occasionally.

                But I am looking more for class libraries which will take care of the properties that are shared between files (and their names).

                Examples:

                • Case-insensitive iteration through file lists
                • Performing an action on each element in a list
                • Determination of directory hierarchies
                • Development challenges around the handling of symbolic links
                VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by
                #7

                @elfring said in Supporting data models for file lists:

                Case-insensitive iteration through file lists

                Iteration has nothing to do with case sensitivity. You can use QDirIterator

                Searching can be case-insensitive using QDir::entryInfoList and passing the QDir::CaseSensitive filter flag

                Performing an action on each element in a list

                that's a for loop using QDirIterator there's nothing fancy

                Determination of directory hierarchies

                Again, QDirIterator can do it: iterator.fileInfo().isDir()

                Development challenges around the handling of symbolic links

                Just pass QDirIterator::FollowSymlinks or not. alternatively you can always use iterator.fileInfo().isSymLink()

                "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
                2
                • E Offline
                  E Offline
                  elfring
                  wrote on last edited by
                  #8

                  Do you get any further software development ideas for the mapping of the following class member variable to a Qt model class when the keys will be file names?

                      std::map<std::string, std::pair<std::vector<error_attributes>, bool>> records;
                  
                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi,

                    QAbstractListModel

                    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
                    3

                    • Login

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