Results 1 to 6 of 6

Thread: QFileDialog - remote browsing possible?

  1. #1
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Question QFileDialog - remote browsing possible?

    I've been scouring the docs looking for a means of running a QFileDialog locally on a remote filesystem, obtaining its data from a QTcpSocket from an application on the other end that can pump FS data back.

    It looks like my best shot would be to re-implement the model that the QFileDialog operates off of with a proxy model on the local side, and run a QFileSystemModel on the remote end, and somehow serialize any requests/responses from the two over the QTcpSocket.

    Is this even possible/feasible? Looking at the QAbstractProxyModel, it looks like I'd need to call 'setSourceModel' on yet another model, that would actually do the legwork to query the socket from the remote QFileSystemModel, so it would look like this:
    Qt Code:
    1. +----------------+ +----------+ +----------+ +----------+ +----------+ +------------------+ +-------------------+ +-----------+
    2. |QFileSystemModel|----|serializer|----|QTcpSocket|----|QTcpSocket|----|serializer|----|QAbstractItemModel|----|QAbstractProxyModel|----|QFileDialog|
    3. +----------------+ +----------+ +----------+ +----------+ +----------+ +------------------+ +-------------------+ +-----------+
    To copy to clipboard, switch view to plain text mode 
    Am I totally off-base with this? Is there an easier way?
    Life without passion is death in disguise

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFileDialog - remote browsing possible?

    Can't you just mount the remote drive as a network share and browse that? It'll do what your trying to do without reimplementing everything.

  3. #3
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QFileDialog - remote browsing possible?

    Not really... the idea is to set inotify watch points on a remote machine (without a keyboard) with a nice GUI app, which may be running any operating system.
    Life without passion is death in disguise

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFileDialog - remote browsing possible?

    Ok, now I'm confused. How were you going to do that with QFileDialog ? If your going to browse the directory structure with a QFileDialog, you might as well share the directory structure over the network and browse the network path.

    Or is there something I'm not getting here?

    Unless of course the QFileDialog was simply to show the directories, and then you could select those directories with your application and it did something with them? But QFileDialog is for selecting files, not directories.


  5. #5
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QFileDialog - remote browsing possible?

    That was the idea - it's just to get a directory (or rather, several directories) from the remote system.

    QFileDialog has, among other things, a static function that allows for selecting directories.

    The how was in the first post (I'd set the model for the QFileDialog's view and that should take care of it)... but it seemed excessive to me and failed to pass the "sanity" check. On the other hand, if it's doable that way, then it's just short of the "too hard to do" point for me and I'll plod forward with it.

    I'm also wondering just how much effort I'm willing to put forward when it can be solved with a simple QLineEdit and a manual entry (no browsing)
    Life without passion is death in disguise

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFileDialog - remote browsing possible?

    So what you really need if you don't want to allow network shares is a FTP-like connection without the "F" part As in, you can browse the directory structure but you can't transfer any files.

    It is a fair amount of work and possibly a lot of maintenance for something if people would be quite happy with a QLineEdit box though. I assume you can get a directory listing in other ways (Most OS support exporting the display and allowing remote control or other means), so all you need do is copy and paste the path, but if you need to connect to the server to setup the final configuration, then you might as well add the browsing part as well. I just wouldn't use a QFileDialog, but maybe a QTreeView instead, should be much easier.

Similar Threads

  1. Remote debugging with Qt Creator
    By rodrigotavares in forum Qt Tools
    Replies: 4
    Last Post: 3rd February 2010, 18:15
  2. QFileDialog - will be closed after selecting a file
    By skyperhh in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2009, 16:49
  3. QFileDialog in Qt designer
    By tpf80 in forum Qt Tools
    Replies: 1
    Last Post: 17th May 2007, 00:41
  4. QFileDialog Mac / PC
    By hey in forum Qt Programming
    Replies: 3
    Last Post: 26th April 2007, 18:23
  5. copy file/s from QFileDialog
    By raphaelf in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 14:26

Tags for this Thread

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.