Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Solved Load image from disk

    QML and Qt Quick
    2
    2
    176
    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.
    • Q
      qcoderpro last edited by

      Hi all,

      I want to load an image I have on my hard disk for the item Image as follows, instead of the .qrc directory:

      Image {
              id: myImage
              source: "C:/Users/QtCoder/Desktop/Captures/4.png"
              anchors.fill: parent
      }
      

      But the image (4.png) is not shown when the project runs.

      ODБOï 1 Reply Last reply Reply Quote 0
      • ODБOï
        ODБOï @qcoderpro last edited by

        hi @qcoderpro

        source : Qt.resolvedUrl("file:///C:/Users/QtCoder/Desktop/Captures/4.png")
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post