Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileDialog::getOpenFileUrl returns empty QUrl after selecting file from ftp server (Windows 8.1)
Forum Updated to NodeBB v4.3 + New Features

QFileDialog::getOpenFileUrl returns empty QUrl after selecting file from ftp server (Windows 8.1)

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gamapat
    wrote on 14 Sept 2016, 07:47 last edited by gamapat
    #1

    Hi, I'm using QFileDialog to select files from local and shared drivers, and it's doing pretty well. But I want to select files from ftp too, just like Mac OS X does. Can I do it somehow?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 14 Sept 2016, 09:23 last edited by VRonin
      #2

      QFileDialog has no dependency on the Qt Network module so it won't be able to do it out of the box. You'll need to subclass it, implement the FTP part yourself.

      I'm not 100% sure but I think Qt5 QNetworkAccessManager is not able to get the list of files from an ftp server ( https://bugreports.qt.io/browse/QTBUG-26294 ) so you might need to compile the old (and unsupported) QFtp from Qt4.8 to achieve your goal.

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      R 1 Reply Last reply 14 Sept 2016, 09:27
      0
      • V VRonin
        14 Sept 2016, 09:23

        QFileDialog has no dependency on the Qt Network module so it won't be able to do it out of the box. You'll need to subclass it, implement the FTP part yourself.

        I'm not 100% sure but I think Qt5 QNetworkAccessManager is not able to get the list of files from an ftp server ( https://bugreports.qt.io/browse/QTBUG-26294 ) so you might need to compile the old (and unsupported) QFtp from Qt4.8 to achieve your goal.

        R Offline
        R Offline
        raven-worx
        Moderators
        wrote on 14 Sept 2016, 09:27 last edited by raven-worx
        #3

        @VRonin said in QFileDialog::getOpenFileUrl returns empty QUrl after selecting file from ftp server (Windows 8.1):

        QFileDialog has no dependency on the Qt Network module so it won't be able to do it out of the box. You'll need to subclass it, implement the FTP part yourself.

        Since he's using QFileDialog::getOpenFileUrl() the native file dialog should be used. So the FTP access isn't done by Qt. Instead Windows should deliver a FTP url, since you can browse ftp:// addresses directly in the Explorer.

        I haven't tested this yet. Maybe there is some code on Qt side which converts it to a local file path implicitly.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        1

        1/3

        14 Sept 2016, 07:47

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved