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

[REG 6.4.0 -> 6.4.1] Second ColorRole change via QPalette:setBrush() does not modify cacheKey

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.4.2, 6.5.0 Beta1
    • 6.4.1
    • GUI: Painting
    • None
    • ef379f95c7 (qt/qtbase/dev) ef379f95c7 (qt/tqtc-qtbase/dev), aa45401ff (6.4)

    Description

      If the brush for the same ColorRole is set twice via QPalette:setBrush(), the second change does ot cause a modification of the cacheKey.

      Example code
      #include <QGuiApplication>
      #include <QDebug>
      #include <QPalette>
      
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
      
          QPalette pal;
      
          qDebug() << pal.cacheKey();
          const QBrush red(Qt::red);
          pal.setBrush(QPalette::All, QPalette::ButtonText, red);
          qDebug() << pal.cacheKey();
          const QBrush green(Qt::green);
          pal.setBrush(QPalette::All, QPalette::ButtonText, green);
          qDebug() << pal.cacheKey();
      
          return 0;
      }
      
      Output when built against Qt 6.4.0 (expected)
      4294967297
      4294967299
      4294967302
      
      Output when built against Qt 6.4.1 (unexpected)
      4294967301
      21474836486
      21474836486
      

      The 6.4.1-based output shows that the second brush change does not modyfy the cacheKey. I believe that is the reason for QTCREATORBUG-28470
      Reverting change https://codereview.qt-project.org/c/qt/qtbase/+/436159 from 6.4.1 makes it work again.

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              portale Alessandro Portale
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes