Results 1 to 2 of 2

Thread: Remote QDirModel ?

  1. #1
    Join Date
    Apr 2006
    Thanked 1 Time in 1 Post
    Qt products
    MacOS X Unix/X11

    Default Remote QDirModel ?


    The QDirModel class provides a data model for the local filesystem.

    I wonder if there is a convenient way to create a QDirModel on a non local directory but from a directory on a server.

    Has anyone already done such a thing ?

    Thanks. Ju.
    Last edited by jwintz; 9th March 2007 at 15:51.

  2. #2
    Join Date
    Mar 2006
    Thanked 4 Times in 3 Posts
    Qt products
    Unix/X11 Windows

    Default Re: Remote QDirModel ?

    You'd need to have a service / daemon running on the server creating the model, then passing it back upon request to the client via some transport mechanism.

    An issue you might face in implementing such a thing is synchronisation and efficiency.
    The updates in the QTreeView is handled with signals / slots.
    You could have the complete model stored on the server and have a the data() method sending the information on demand via some proxy class which handles the connection, but I doubt that you'd get decent refreshes when constantly polling the server over an http connection, partly due to the time to send the data, but also because each request has too many handshakes to acknowledge before the data is actually sent (maybe UDP would work).

    Another option could be to simply send the entire model over to the client, then implement a QFileSystemWatcher which would send a new model to the client whenever a change is detected.
    Typically the File System watcher just monitors a single folder, but you could make a controller class for it to monitor the dirmodel's base folder and sub folders for changes.

    Which option you choose would depend on the circumstances. The latter option would mean that the server would be busy monitoring and might slow the machine down, but the first option would clag up the network.

    Maybe there are other options.
    I hope this helps

    Steve York

Similar Threads

  1. QDirModel - show directory ".."?
    By jamd in forum Qt Programming
    Replies: 3
    Last Post: 23rd April 2009, 19:51
  2. Mozilla/Firefox remote command
    By larsli in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2007, 08:23
  3. QDirModel, Model/View, extend the file onfo
    By VlJE in forum Qt Programming
    Replies: 10
    Last Post: 11th December 2006, 10:56
  4. QDirModel and a QTreeView.
    By jamd in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 09:41
  5. How to determine ip address of remote host?
    By nopalot in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2006, 21:18


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.