Results 1 to 7 of 7

Thread: File Dialog / Network Protocols in QT4

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Location
    New York
    Posts
    45
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11
    Thanks
    5

    Default Re: File Dialog / Network Protocols in QT4

    Unfortunately, it seems like QFSFileEngine is especially split between OS implementations, and is very connected to the local file system. I don't think subclassing is possible, or rather, it's pointless because so many methods would need to be overridden.

    The files I want to list are not local to the file system, and therefore the FileDialog should never need to access the local file system (except to load icons).

    I have started to write a QAbstractFileEngine subclass, but things don't seem to work right.

    The example in the documentation on QAbstractFileEngineIterator has bugs in it. It puts the iterator on the first item, which means that the first item is never retrieved. I changed the index(0) to index(-1) which helps (after fixing currentFileName to check for -1). Also, filterNames and filters seems reversed in the documentation (which is easy to fix, but still seems like a typo).

    But when the dialog is created it seems to search for history items, which seem to default to the currentDirectory (of the application). Then I set history to an empty list, and the sidebar urls to an empty list, but entries never show up in the dialog.

    After searching, I find in the code that QDirIterator is a friend to QAbstractFileEngine, which is frustrating because this disallows me to set the path() of the iterator, and instead it inherits the dir from when the FileDialog was created. Perhaps my iterator has to subclass QDirIterator? But what do I do with QDirIteratorPrivate?

    Is it really bad to use Q3NetworkProtocol, I mean, are they really gonna get rid of it?

  2. #2
    Join Date
    Jul 2007
    Location
    New York
    Posts
    45
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11
    Thanks
    5

    Default Re: File Dialog / Network Protocols in QT4

    this is interesting...

    http://lists.trolltech.com/qt-intere.../msg00693.html

    I think it's a wash... I should build my own FileDialog.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: File Dialog / Network Protocols in QT4

    Quote Originally Posted by themolecule View Post
    Unfortunately, it seems like QFSFileEngine is especially split between OS implementations, and is very connected to the local file system. I don't think subclassing is possible, or rather, it's pointless because so many methods would need to be overridden.
    In my opinion there shouldn't be much work with it. In general you'd need to translate file paths and call default implementations.

Similar Threads

  1. File Open dialog with preview?
    By will49 in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2007, 18:08
  2. Replies: 4
    Last Post: 13th June 2007, 15:37
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. preview file dialog
    By mickey in forum Qt Programming
    Replies: 11
    Last Post: 21st April 2006, 23:03
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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
  •  
Qt is a trademark of The Qt Company.