Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Images in assets folder not being read by Image Object

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23502

    Declan Harty

    I’m trying to use several images as markers for an AppMap in an app, and the Image item that I’m using to find them hasn’t been able to open the files I want to use. This is the code that I’ve been using.

    MapQuickItem {
                    id: quick
                    anchorPoint.x: image.width/2
                    anchorPoint.y: image.height
                    coordinate: map.center
                    zoomLevel: 13
                    visible: true
    
                    sourceItem: Image {
                        id: image
                        source: "qrc:/assets/bubbler-pin.png"
                    }

    The weirdest thing to me is that the felgo-logo.png file, which is in the same directory as these files as far as I can tell, works completely fine for this process, but none of the files I’ve attempted to use do, instead returning this error message:

    file:/AmenityFinder/qml/Pages/AmenityFinderMainPage.qml:44: QML Image: Cannot open: qrc:/assets/bubbler-pin.png

    This is the file I’m using:

    https://drive.google.com/file/d/1dCErrlAUwXB1-FsnDOxQsZb6iE0N3U-z/view?usp=sharing

    Any help anyone could give would be greatly appreciated.

    #23521

    Alex
    Felgo Team

    Hi,

    you do not need to specify

    qrc:/

    explicitly in the URL. You can see in our example how to access the images with a relative url. Also, if you want to use qrc explicitly, did you add the image to the resource qrc file of your project?

    Best,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded