Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to set the the path of images in qml, if the image is not in qml resource ?
Qt 6.12 LTS is out! See what's new in the release blog

How to set the the path of images in qml, if the image is not in qml resource ?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 1 Posters 1.0k Views 1 Watching
  • 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.
  • chawilaC Offline
    chawilaC Offline
    chawila
    wrote on last edited by chawila
    #1

    As we know , when loading image file that is IN the resource file,
    we can set the path of images by relative path or absoulte path with:

    images/xx.jpg
    

    where images is our prefix

    And when loading image file that is NOT in the resource file,
    we can set the path of images by relative path or absoulte path with:


    Linux

    file:///home/username/Pictures/xx.jpg
    

    Windows

    something like :

    file:///C:/users/username/Pictures/xx.jpg
    

    Questions is

    How do i make these work even on android and or other mobile devices?.
    because i`m developing these app for mobile devices, and it should download some images from Internet and store them for later use


    NB

    My problem here is not getting the path to the file.
    i can get the path with QStandardPaths(in c++ then pass it to qml).
    Rather my problem is linking that path i have.


    i hope i`m making point

    1 Reply Last reply
    0
    • chawilaC Offline
      chawilaC Offline
      chawila
      wrote on last edited by chawila
      #2

      NB

      My problem here is not getting the path to the file.
      i can get the path with QStandardPaths(in c++ then pass it to qml).
      Rather my problem is linking that path i have.

      1 Reply Last reply
      0
      • chawilaC Offline
        chawilaC Offline
        chawila
        wrote on last edited by
        #3

        Sorry guys there is no problem here, i had a typo somewhere in my code.


        Realy appologise.

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