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

QBrush scale transformation is not applied correctly in Qt 6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • 6.3.1
    • GUI: Painting
    • None
    • Intel MBP 2017, macOS 12.4, Windows 10
    • macOS, Windows

    Description

       

      In the attached project, the custom widgets are filled with a pattern with predefined scales:

          void paintEvent( QPaintEvent* e ) override
          {
              QPainter p( this );
      
              QBrush br = QBrush( Qt::blue, Qt::CrossPattern );
              QTransform tr;
              tr.scale( mScale, mScale );
              br.setTransform( tr );
      
              p.fillRect( e->rect(), br );
          }

      With Qt 5.15.2, the widgets have a correct scale of pattern:

      • OK_qbrush_scale_mac_5.15.2.png
      • OK_qbrush_scale_win_5.15.2.png

      With Qt 6.3.1, the widgets have the same scale:

      • FAIL_qbrush_scale_mac_6.3.1.png
      • FAIL_qbrush_scale_win_6.3.1.png

      Note, on macOS (retina screen) with Qt 6.3.1 the scale is even smaller than on Windows, while with Qt 5.15.2 they are equal.

      QGraphicsScene and QGraphicsView are also affected, setBackgroundBrush method produces the same result.

       

      Attachments

        1. FAIL_qbrush_scale_mac_6.3.1.png
          25 kB
          Sergey Pashkov
        2. FAIL_qbrush_scale_win_6.3.1.png
          23 kB
          Sergey Pashkov
        3. OK_qbrush_scale_mac_5.15.2.png
          27 kB
          Sergey Pashkov
        4. OK_qbrush_scale_win_5.15.2.png
          24 kB
          Sergey Pashkov
        5. QBRUSH_SCALE.zip
          3 kB
          Sergey Pashkov

        Issue Links

          Activity

            People

              vgt Eirik Aavitsland
              sergey_pashkov Sergey Pashkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: