Select to view content in your preferred language

How to get the absolute path of a file/image

01-07-2021 07:45 AM
New Contributor III

I need absolute path of a file suppose my path structure is like this

Here i want to show the image
                   Image {
                        id: img
                        fillMode: Image.PreserveAspectFit
                        anchors.centerIn: parent

By using this "../assets/images/imagename.png"  the image is showing on normal pages, but on map pages where i have to show the marker images and tracking image , these are not showing. And I also have tried this  Qt.resolvedUrl (URL), it is also not working. Doesn't shows any error but images are also not showing.  Is there anything to get an absolute file path so that it will work in every device and every page. 

also while testing the app on android device the images are showing but on iphone it's not showing. I don't understand what's wrong. 

Tags (2)
1 Reply
Esri Contributor

You can do /project_folder/whatever/whatever

That will always reference from your project folder. 

0 Kudos