Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to get file path from fileurl in qt android

    Mobile and Embedded
    android qt 5.4 file dialog fileurl mobile
    2
    3
    530
    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
      HemantSuryawanshi last edited by

      I am working on qt 5.14.1 with ndk version 21 and sdk version 28. I want to open a kml file using file dialog in qt android. I get a fileurl from file dialog like this,

      "content://com.android.externalstorage.documents/document/primary%3Adocuments%2FAeroGCS%2FAeroGCSWorkspace%2FAbc5%2FBbb%2FBbb.kml"
      

      but I didnt know how to convert this url into simple path and read the data from file. Please tell me how can I convert this url into proper android path.

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @HemantSuryawanshi last edited by

        @HemantSuryawanshi
        I don't know anything about Android, but did you try passing that string to QFile() directly? Or, what about via QString QUrl::toLocalFile() const? Just a thought, may not help....

        H 1 Reply Last reply Reply Quote 0
        • H
          HemantSuryawanshi @JonB last edited by

          @JonB yes I tried but its giving message that the file is not found.

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