Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to get file path from fileurl in qt android



  • 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.



  • @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....



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