Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Solved image invisible in Qt 5.9 works fine in 5.8

    QML and Qt Quick
    1
    2
    437
    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.
    • M
      Marek last edited by

      Hi,

      I have fairly simple MapQuickItem

      MapQuickItem {
          property int rs_id
          property int item_type: 1 //1-marker 2-circle 3-navi 4-bus 5-info
          property int naviMap;
          property int pressed: 0
          property int old_x;
          property int old_y;
          property int moved: 0
          visible: true;
          sourceItem: Image {
              id: image
              scale: 0.1
              source: "images/map-marker-blue.png"
              visible: true
      
          }
          anchorPoint.x: image.width/2
          anchorPoint.y: image.height
      }
      

      It works fine with Qt 5.8 and is invisible with Qt 5.9
      With 5.9 no error is being shown, I just can't see the image, if I make intentional mistake in source url it complains:

      qrc:/MarkerItem.qml:15:17: QML Image: Cannot open: qrc:/images/map-marker-blu.png
      

      But when the path is correct, no error is written and the image is simply invisible, component is created it even has the right size, but it is just like completely transparent. I have tested on Windows 10 and Linux 64Bit
      Has something changed in 5.9 or what?

      Best Regards
      Marek

      1 Reply Last reply Reply Quote 0
      • M
        Marek last edited by

        Ok, I have found the problem:

        scale: 0.1
        

        This settings does not work in Qt 5.8 (item is always 100% size) and it does in 5.9
        My mistake.

        Regards
        Marek

        1 Reply Last reply Reply Quote 0
        • First post
          Last post