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 :: getExistingDirectory in the explorer does not display the directories of connected devices
QtWS25 Last Chance

QFileDialog :: getExistingDirectory in the explorer does not display the directories of connected devices

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 506 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.
  • H Offline
    H Offline
    haifisch
    wrote on last edited by
    #1

    I have a phone connected and it is displayed in Explorer:
    alt text
    But when I try to open the explorer using the code in the program:

    void IdentifyDevice::Explorer()
    {
        QString path = QFileDialog::getExistingDirectory(this, tr("Открыть каталог"),
                                                        "/home",
                                                        QFileDialog::DontResolveSymlinks);
        DevicePathLineEdit->setText(path);
    }
    
    

    alt text

    Apple iPhone devices not in "Devices and drives." How to display all devices that are connected in "Devices and drives"?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This is not supported since this location does not return a valid file path I would guess (the call to SHBrowseForFolder explicitly states that Qt needs a valid url: https://code.woboq.org/qt5/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp.html#1816 and https://docs.microsoft.com/de-de/windows/win32/api/shlobj_core/ns-shlobj_core-browseinfoa / BIF_RETURNONLYFSDIRS )

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      H 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        This is not supported since this location does not return a valid file path I would guess (the call to SHBrowseForFolder explicitly states that Qt needs a valid url: https://code.woboq.org/qt5/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp.html#1816 and https://docs.microsoft.com/de-de/windows/win32/api/shlobj_core/ns-shlobj_core-browseinfoa / BIF_RETURNONLYFSDIRS )

        H Offline
        H Offline
        haifisch
        wrote on last edited by
        #3

        @Christian-Ehrlicher Is there any way to do this? I need to identify the device in the program and specify the path to the device

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @haifisch said in QFileDialog :: getExistingDirectory in the explorer does not display the directories of connected devices:

          Is there any way to do this?

          Not with Qt. But as you can see in the calling the WinAPI isn't that hard.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          H 2 Replies Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            @haifisch said in QFileDialog :: getExistingDirectory in the explorer does not display the directories of connected devices:

            Is there any way to do this?

            Not with Qt. But as you can see in the calling the WinAPI isn't that hard.

            H Offline
            H Offline
            haifisch
            wrote on last edited by
            #5

            @Christian-Ehrlicher thanks I will try

            1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @haifisch said in QFileDialog :: getExistingDirectory in the explorer does not display the directories of connected devices:

              Is there any way to do this?

              Not with Qt. But as you can see in the calling the WinAPI isn't that hard.

              H Offline
              H Offline
              haifisch
              wrote on last edited by
              #6

              @Christian-Ehrlicher I do not understand which library I need to connect for

              BROWSEINFO bi;
              
              1 Reply Last reply
              0
              • Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @haifisch said in QFileDialog :: getExistingDirectory in the explorer does not display the directories of connected devices:

                which library I need to connect for

                See the documentation link I gave you, at the bottom.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                0

                • Login

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