Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QIcon Hi DPI (retina) from QPixMap
Forum Updated to NodeBB v4.3 + New Features

QIcon Hi DPI (retina) from QPixMap

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 1 Posters 387 Views 1 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    The QIcon doc suggests using files to create Hi DPI icons. but if that's not possible, because you programmatically create QPixMaps, or because your existing subsystem uses QPixMaps for everything, or any other valid reason, then it is not possible to create Hi DPI QIcons.

    When attempting to create QIcon from QPixMap, you'd expect to be able to do this:

    qPix->setDevicePixelRatio(devicePixelRatio());
    
    QIcon		icon(qPix);  // <-- we should be good to go now, right?
    

    and have the scale setting (why is it called PixelRatio?) to be preserved in the icon, but it is not. :(

    is there some magic invocation i can do to get this to work with QPixMaps (not files, and not themes) ?

    see how all icons come out low-dpi:
    0_1557863382934_Screen Shot 2019-05-14 at 12.47.24 PM.png

    This bug was previously reported here, but then ignored because... the maintainer thought the report was ... "too convoluted to be useful" (?) It seems quite straight forward to me, IMHO :)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #2

      filed a bug

      1 Reply Last reply
      2
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #3

        please: if you would also like to see this bug in Qt fixed, please click the bug and upvote it. thanks.

        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