Forums

OverviewFelgo 2 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support