Python Forum
[PyQt] QLinearGradient Banding
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] QLinearGradient Banding
#1
Hi,

I am creating an application with PyQt5. I originally was using an image for the background of my program that has the correct gradient however recently wanted to make the interface dynamic/re-sizable.

To create and set the gradient, in the main window, I am using:

p = QPalette()
gradient = QLinearGradient(0, 0, 300, 400)
gradient.setColorAt(1.0, QColor(26, 29, 32))
gradient.setColorAt(0.0, QColor(39, 44, 49))
p.setBrush(QPalette.Window, QBrush(gradient))
self.setPalette(p)
The gradient however has banding between colours, it's not massively obvious in this picture but definitely present. I imagine it has something to do with colour depth but am unsure how to fix the issue.

[Image: 2mriaAr.png]
Reply


Messages In This Thread
QLinearGradient Banding - by kainev - Aug-09-2019, 06:49 AM
RE: QLinearGradient Banding - by Alfalfa - Aug-09-2019, 05:22 PM
RE: QLinearGradient Banding - by kainev - Aug-15-2019, 02:04 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020