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

REG 5.8->5.9: When copy-constructing a pixmap with active painters, the device pixel ratio is dropped

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.9.0 Alpha
    • Fix Version/s: 5.9.0 Alpha
    • Component/s: GUI: Painting
    • Labels:
      None
    • Environment:
      Windows 10, MSVC2015 U3, 64bit, Linux
    • Commits:
      91120599aee881bd1021087bae91fd1d5de46a4c (qtbase/5.9, 6.2.2017, 5.9)

      Description

         QApplication a(argc, argv);
          QPixmap pm;
          pm = QPixmap(100, 100);
          pm.fill(Qt::red);
          pm.setDevicePixelRatio(2);
          QPainter p;
          p.begin(&pm);
          QPixmap pm2(pm);
          p.end();
          qDebug() << QT_VERSION_STR << pm << '\n' << pm2;
      

      produces

      5.9.0 QPixmap(QSize(100, 100),depth=32,devicePixelRatio=2,cacheKey=0x100000003)
       QPixmap(QSize(100, 100),depth=32,devicePixelRatio=1,cacheKey=0x400000001)
      

      as opposed to

      5.8.1 QPixmap(QSize(100, 100),depth=32,devicePixelRatio=2,cacheKey=0x100000003)
       QPixmap(QSize(100, 100),depth=32,devicePixelRatio=2,cacheKey=0x400000001)
      

      Manifests a Qt Creator's mode bar looking all messed up on High DPI screens since it inserts QPixmaps with DPR=2 with active painters into QPixmapCache and later gets pixmaps with DPR=1 out of it.

        Attachments

        1. qtbug58653_creator_diag.diff
          3 kB
        2. qtbug58653_creator.jpg
          qtbug58653_creator.jpg
          77 kB
        3. qtbug58653_creatorlog.txt
          6 kB
        4. qtbug58653.zip
          1 kB

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              kleint Friedemann Kleint
              Reporter:
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes