Results 1 to 6 of 6

Thread: What is replacement for QAbstractFileEngine?

  1. #1
    Join Date
    Sep 2021
    Posts
    6
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: What is replacement for QAbstractFileEngine?

    In Qt4 I was able to create my own system of resource files with QAbstractFileEngine.
    This project now have to migrate to Qt6 and I see that this class is no longer exist in Qt?
    Was it deprecated and replaced with something?
    What is the modern way to create my own support for my own file systems?


    Added after 13 minutes:


    I found a lot of messages in different mail-lists that QAbstractFileEngine is indeed deprecated in 4.8 and removed in 5.0, but what is the modern way to do virtual file systems?
    Last edited by White_Owl; 29th September 2021 at 17:15.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: What is replacement for QAbstractFileEngine?

    You may be able to derive from QFileSystemModel or implement something which uses QDir, QFile, and QFileInfo instead.

    Alternatively, you may be able to add the Qt 4.8 source code for QAbstractFileEngine into your local project. It probably depends on whether the other classes it might use have changed in a way that make it incompatible with Qt 6. If you do add it locally, it would be a good idea to rename the files and the class to something that will not conflict with Qt itself. From the documentation of Qt5 changes, it sounds like this class might still exist internally, but it is no longer public.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Sep 2021
    Posts
    6
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: What is replacement for QAbstractFileEngine?

    Are there any examples on how to use QFileSystemModel as basis for virtual FS?

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: What is replacement for QAbstractFileEngine?

    I found only one real example of subclassing QFileSystemModel.

    But I guess I don't really understand how your "system of resource files" works. Are these virtual entries that appear as part of the actual file system? That is, in a certain real directory, are there entries for real files as well as for virtual resource files? Or is your entire "file system" virtual - nothing in it represents a real directory and file hierarchy, everything is virtual?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Sep 2021
    Posts
    6
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: What is replacement for QAbstractFileEngine?

    The current system have two VFS (three if you count standard qrc file):

    One works with database blobs as files:
    File b("#articles/123/textField");
    Means: open for read-write blob from table 'articles', from row with primary key 123. field 'textField'.

    Second hides in itself an FTP protocol:
    File f("@server/path/file");

    That gives kind of convenient way to move data between network and database. IT certainly can be rewritten to a more traditional way, but...

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: What is replacement for QAbstractFileEngine?

    IT certainly can be rewritten to a more traditional way, but...
    I think your easiest solution might be to copy the code for QAbstractFileEngine from Qt 4.8, rename it, and see if you can build it using Qt 6. I don't have a Qt4 installation any more, so I can't check the source code.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 0
    Last Post: 17th May 2012, 10:02
  2. Replacement for QTimer?
    By SKolaMunn in forum Qt Programming
    Replies: 4
    Last Post: 17th October 2011, 17:55
  3. Replies: 0
    Last Post: 20th December 2010, 18:38
  4. OR combination flags in QAbstractFileEngine
    By pmaktieh.sirhc in forum Qt Programming
    Replies: 2
    Last Post: 21st March 2007, 13:31
  5. Replacement of Images
    By merry in forum Qt Programming
    Replies: 5
    Last Post: 1st March 2007, 11:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.