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

Regression with gradient as a QLineEdit background

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.3, 5.12.9, 5.15.1
    • GUI: Painting
    • None
    • macOS

    Description

      Hi there!

      I just have found error with QLineEdit background painting and it goes way back with Qt versions. This bug only present on MacOS. In my case it is High Sierra 10.13.6 and running in VM. But bug also present on real hardware.

      I use modified QLineEdit example (archive included). Problem arise as modified palette with QLinearGradient (or QRadialGradient) set as a brush for Base color group. So I added this code into example to show this bug:

       layout->activate();
       echoLayout->activate();
       QPalette mDefaultPalette = echoLineEdit->palette();
       QPalette mGreenGradientPalette = mDefaultPalette;
       QRect rect = echoLineEdit->geometry();
       QLinearGradient grad = QLinearGradient(QPointF(0, 0), QPointF(rect.width(), rect.height()));
       grad.setColorAt(0, Qt::white);
       grad.setColorAt(0.4, Qt::gray);
       grad.setColorAt(1, Qt::green);
       mGreenGradientPalette.setBrush(QPalette::Base, QBrush(grad));
       mGreenGradientPalette.setBrush(QPalette::Text, QBrush(Qt::blue));
      echoLineEdit->setPalette(mGreenGradientPalette);
      

      Results from MacOSX:

      Qt 5.10.1 looks fine:

      Qt 5.11.3 first sign of a problem, background seems untouched:

      Qt 5.12.9 get even worse, background gone full black:

      Qt 5.15.1 same deal as 5.12.9:

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            shuras109 Aleksandr Sbitnev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes