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::getOpenFileName for android phone in usb with PC
Forum Updated to NodeBB v4.3 + New Features

QFileDialog::getOpenFileName for android phone in usb with PC

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

    Hi, I have a smartphone (android) connected to my PC (W10) and in Qt C++ code, I would access to some folder on that phone: I try QFileDialog::getOpenFileName() but I don't see the phone in the dialog while W10 shows it to me in the explorer...
    Is there a way to be able to overcome this?
    By waiting, I use adb.exe with QProcess to send shell command (developer mode on the phone) to be able to accesss the content of SD card (adb shell ls -al /storage/6231-3134) but if there a solution with getOpenFileName, I should prefer....

    JonBJ 1 Reply Last reply
    0
    • V Veigh44

      Hi, I have a smartphone (android) connected to my PC (W10) and in Qt C++ code, I would access to some folder on that phone: I try QFileDialog::getOpenFileName() but I don't see the phone in the dialog while W10 shows it to me in the explorer...
      Is there a way to be able to overcome this?
      By waiting, I use adb.exe with QProcess to send shell command (developer mode on the phone) to be able to accesss the content of SD card (adb shell ls -al /storage/6231-3134) but if there a solution with getOpenFileName, I should prefer....

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Veigh44 said in QFileDialog::getOpenFileName for android phone in usb with PC:

      I try QFileDialog::getOpenFileName() but I don't see the phone in the dialog while W10 shows it to me in the explorer...

      When Explorer shows the phone to you it's somewhere like under Computer or My PC or similar. From the dialog shown by QFileDialog::getOpenFileName(), do you browse to the same place to try to find it?

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Veigh44
        wrote on last edited by
        #3

        Well, when using QFileDialog::getOpenFileName() , in fact, it's working as I can see the phone in the resources viewed by the dialog; but when using QFileDialog::getExistingDirectory(), this time the phone isn't visible in My PC in the dialog; only the hard disk partitions or external disk or USB keys appear...
        I presume that is due to android rights. But W10 let me see the folders...

        Usually I still code with Qt 4.8.7 but I also tried here with Qt 5.15 just to see if I have the same (this is the case!).

        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