Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.11.3, 5.12.9, 5.15.1
-
None
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: