Results 1 to 2 of 2

Thread: QDirModel, QCompleter, and Windows UNC paths

  1. #1

    Default QDirModel, QCompleter, and Windows UNC paths

    All-

    I'm having trouble getting a QDirModel to work nicely with a QCompleter and Windows UNC paths (\\Server\Share\((folder\)*)file -formatted paths).

    The examples work perfectly for all "local" paths with drive letters (even mounted network paths), but UNC seems to stump the QDirModel.

    The model seems to be initialized with all the drives (A:, C:, D:, Q:, etc) -- is there a way to initialize it with a server or server/share?

    Assuming that can be done, should the QCompleter just be aware of the directory/file structure? I would think so as the completer is interpreting the data from the underlying model, but I just want to be sure...

    Thanks in advance!

    SnarlCat

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

    Default Re: QDirModel, QCompleter, and Windows UNC paths

    As far as I remember from my own experiments QDirModel can be initialized from any valid path accepted by Qt (contrary to QFileSystemModel which only accepts real paths) so if you implement a file handler similar to the one used for resource files, you should be able to get the desired output. But it will work very slow, QDirModel is far from being optimal so it might be easier to implement a completely custom model that would first fetch the desired content using native samba calls and then initialize itself with the data.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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.