Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82738

QPixmap Bigger Than Same QIcon?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.14.1
    • Widgets: Itemviews
    • None
    • Windows 10
      Dell 4k 27" Monitor
      250% Scaling in Windows DPI Settings
    • Windows

      In our project the tree model returns a mixture of QIcon and QPixmap, all of which are created from the same files at the same resolution (18 by 18 pixels). I noticed that when high dpi scaling is enabled, the QPixmaps seem to be bigger which looked really odd being mixed together. So I created a reproducible and sure enough was able to reproduce it in a more standard out of the box tree model.

      It seems to be directly influenced by Qt::AA_EnableHighDpiScaling as when this attribute is set in main before the QApplication is constructed, the tree view in my reproducer that returns QPixmap from the same file, instead of QIcon, looks way bigger.

      This is not simply a matter of I consider this to be a bug, as I would expect them to all be equal in size, I also find it confusing. If this is not a bug at the very least I think an explanation would be helpful.

        1. treemodel-pixmap-hidpi-bug.zip
          4 kB
        2. regular-qpixmap-bigger-qicon.png
          regular-qpixmap-bigger-qicon.png
          2 kB
        3. image-2020-03-09-15-36-24-838.png
          image-2020-03-09-15-36-24-838.png
          2 kB
        4. hidpi.png
          hidpi.png
          77 kB
        5. dpiunaware.png
          dpiunaware.png
          28 kB
        6. 1080p-pixmap-bigger.png
          1080p-pixmap-bigger.png
          16 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            RobertBColton Robert B. Colton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes