Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    2
    7
    169
    Loading More Posts
    • 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
      haifisch last edited by

      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 Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        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 has to stay free or it will die.

        H 1 Reply Last reply Reply Quote 2
        • H
          haifisch @Christian Ehrlicher last edited by

          @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 Reply Quote 0
          • Christian Ehrlicher
            Christian Ehrlicher Lifetime Qt Champion last edited by

            @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 has to stay free or it will die.

            H 2 Replies Last reply Reply Quote 1
            • H
              haifisch @Christian Ehrlicher last edited by

              @Christian-Ehrlicher thanks I will try

              1 Reply Last reply Reply Quote 0
              • H
                haifisch @Christian Ehrlicher last edited by

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

                BROWSEINFO bi;
                
                1 Reply Last reply Reply Quote 0
                • Christian Ehrlicher
                  Christian Ehrlicher Lifetime Qt Champion last edited by

                  @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 has to stay free or it will die.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post