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. name.png vs name@2x.png
Forum Updated to NodeBB v4.3 + New Features

name.png vs name@2x.png

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.1k 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.
  • P Offline
    P Offline
    pAkar
    wrote on last edited by pAkar
    #1

    Hi,

    Im experimenting with QtQuick/QML and I am running into something that is confusing me. I understand that the @2x images will be loaded automatically on displays with higher density but why the @2x wont load when I explicitly mention the url for the @2x image?

       Image {
            x: 10
            y: 10
            source: "qrc:/C:/path/name.png"
        }
        Image {
            x: 100
            y:100
            source: "qrc:/C:/path/name@2x.png"
        }
    

    Both images will have the same size.
    If I rename the @2x image to namebigger.png for example it works fine.

    What is happening under the hood exactly here?

    Thanks

    Edit: @2x images are not even loading on retina display. Are there any steps that I need to take other than making them into a resource?

    ODБOïO 1 Reply Last reply
    0
    • P pAkar

      Hi,

      Im experimenting with QtQuick/QML and I am running into something that is confusing me. I understand that the @2x images will be loaded automatically on displays with higher density but why the @2x wont load when I explicitly mention the url for the @2x image?

         Image {
              x: 10
              y: 10
              source: "qrc:/C:/path/name.png"
          }
          Image {
              x: 100
              y:100
              source: "qrc:/C:/path/name@2x.png"
          }
      

      Both images will have the same size.
      If I rename the @2x image to namebigger.png for example it works fine.

      What is happening under the hood exactly here?

      Thanks

      Edit: @2x images are not even loading on retina display. Are there any steps that I need to take other than making them into a resource?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi
      @pAkar said in name.png vs name@2x.png:

      What is happening under the hood exactly here?

      answers are here https://doc.qt.io/qt-5/scalability.html

      @pAkar said in name.png vs name@2x.png:

      source: "qrc:/C:/path/name.png"

      are you sure the path is correct ? to me it looks wrong
      try

      source: "file:///C:/path/name.png"
      
      1 Reply Last reply
      0

      • Login

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