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
Forum Updated to NodeBB v4.3 + New Features

Load image from disk

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 455 Views 2 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.
  • Q Offline
    Q Offline
    qcoderpro
    wrote on 6 Feb 2021, 12:46 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.

    O 1 Reply Last reply 6 Feb 2021, 13:03
    0
    • Q qcoderpro
      6 Feb 2021, 12:46

      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.

      O Offline
      O Offline
      ODБOï
      wrote on 6 Feb 2021, 13:03 last edited by
      #2

      hi @qcoderpro

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

      1/2

      6 Feb 2021, 12:46

      • Login

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