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

QPainter::drawPixmapFragments does not take dpi into account.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15
    • Fix Version/s: None
    • Component/s: GUI: High-DPI
    • Labels:
      None
    • Platform/s:
      All

      Description

      I'd expect the following implementations to give exactly the same result, assuming:

        QPixmap m_bgCache;
        QPainter* p;
      

      A/

        p->drawPixmap(QPointF{}, m_bgCache);
      

      B/

        QPainter::PixmapFragment fragment{
          0., 0.,
          0., 0.,
          (qreal)m_bgCache.width(), (qreal) m_bgCache.height(),
          1., 1.,
          0., 1.
        };
      
        p->drawPixmapFragments(&fragment, 1, m_bgCache);
      

      Alas, first case gives me good.png and second case gives me bad.png

        Attachments

        1. bad.png
          bad.png
          7 kB
        2. good.png
          good.png
          15 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            jcelerier Jean-Michaël Celerier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes