Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QRadialGradient is pixelated
goocreations last edited by
I've been experimenting with QRadialGradient and noticed that the gradient shows up as rectangles (pixelated). I guess this was implemented like this to reduce the intensity of the computation (it looks something like bilinear interpolation or cubic convolution), after all, it is easier to draw rectangles than circles.
My problem is that this pixelation gets well visible at smaller circles (eg: 80, 80). Is there any way I can reduce this pixelation?
I've added the code I'm using and the results of the drawing. I've also tried to use QPainter::HighQualityAntialiasing and QPainter::SmoothPixmapTransform, but without much change.
@ QImage::Format format = QImage::Format_ARGB32;
QImage buffer(qCeil(width), qCeil(height), format);
buffer.fill(qRgba(255, 255, 255, 0));
QRadialGradient radialGradient(QPointF(width / 2, height /2), qMax(width, height) / 2);
QColor color = ViThemeManager::color(14);
painter.drawRect(0, 0, width, height);