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

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.0 Alpha
    • 5.9.0 Alpha
    • GUI: Painting
    • None
    • Windows 10, MSVC2015 U3, 64bit, Linux
    • 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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: