Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. Can I make own file system access with QFileSystemModel?
Forum Updated to NodeBB v4.3 + New Features

Can I make own file system access with QFileSystemModel?

Scheduled Pinned Locked Moved Brainstorm
10 Posts 5 Posters 8.6k Views 1 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.
  • Z Offline
    Z Offline
    zither
    wrote on 15 Oct 2011, 16:08 last edited by
    #1

    Dear all,

    QFileSystemModel is used to access data model for local file system.

    Is that possible to access own file system? (e.g., custom file system which contains in single file like virtual CD, ISO files)

    Is there will be need to modified QFileSystemModel?

    Thanks

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mirswith
      wrote on 15 Oct 2011, 17:06 last edited by
      #2

      Why not subclass QAbstractItemModel and provide the data as you see fit?

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zither
        wrote on 15 Oct 2011, 22:12 last edited by
        #3

        Yes, but it needs to make a new class similar like QFileSystemModel.

        I would like to know is there any way to make file system file to access with QFileSystemModel.

        I would like to access such file structure on my custom file system with QFileSystemModel because new implementation will make a huge cost...

        Thanks

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mirswith
          wrote on 15 Oct 2011, 23:35 last edited by
          #4

          If you need to present your custom file system the same way QFileSystemModel does then you really do need to subclass QAbstractItemModel (the same as QFileSystemModel) and implement the details. Even if you subclassed QFileSystemModel you would have to override all of its methods anyway to provide your own data at which point you might as well just subclass QAbstractItemModel.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on 16 Oct 2011, 10:24 last edited by
            #5

            Sounds like you are looking for [[doc:QAbstractFileEngine]]. I am not sure it is used for QFileSystemModel though, and AFAIK it will not return in Qt5, as it is now considdered a design mistake. However, if Qt5 compatibility is not an issue for you, then perhaps it is a solution for your case.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zither
              wrote on 16 Oct 2011, 13:23 last edited by
              #6

              yes, thanks.
              it looks right option for me.

              Can I know any substitute solution for that class in Qt5 when it is removed?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on 16 Oct 2011, 13:27 last edited by
                #7

                There is an overview somewhere on the status of modules. I am not actually sure that it will be removed, it might just be depricated. Dig for some more information on this before you commit to using the technology. Also: I am not sure QFileSystemModel actually uses this abstraction. The documentation of QAbstractFileEngline only mentions QDir, QFile and QFileInfo.

                AFAIK, there is not going to be a replacement. The feeling is, if I understand & remember it correctly, that Qt is the wrong level to solve the issue, and it should be solved at the OS level instead.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lgeyer
                  wrote on 16 Oct 2011, 14:46 last edited by
                  #8

                  "Qt Modules’ Maturity Level":http://labs.qt.nokia.com/2011/05/12/qt-modules-maturity-level-the-list/
                  [quote]
                  Abstract file engines
                  State: Deprecated
                  Reasoning: flawed design, this is the wrong level to provide a virtual filesystem, so we don’t recommend taking this over. In Qt 5, this functionality will be Removed.
                  [/quote]

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    zither
                    wrote on 16 Oct 2011, 18:19 last edited by
                    #9

                    Thanks for your info.

                    So, how will be suitable method to provide such custom virtual file system?

                    Thanks

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jaysistar
                      wrote on 1 Feb 2014, 15:49 last edited by
                      #10

                      It looks like this was never answered. It's strange to me that QAbstractFileEngine was taken out considering Android "assets:" was added, "qrc:" has always been around, and it would be a really seamless way to integrate many things that just can't be integrated at the OS level when you don't have full control over the machine. How is it a "design flaw" to have this interface? Is GDAL VSI flawed? I think that's a matter of opinion, but the fact remains that many libraries have to work with both file and memory APIs. If a library is based on Qt, it would be nice to be able to make an abstract file system and be done with integration.

                      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