Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Load image from disk
QtWS25 Last Chance

Load image from disk

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 453 Views
  • 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 Offline
    Q Offline
    qcoderpro
    wrote on last edited by
    #1

    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ïO 1 Reply Last reply
    0
    • Q qcoderpro

      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ïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi @qcoderpro

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

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved