QColorDialog: Streamline painting code of QColorLuminancePicker.
Task-number: QTBUG-36078 Change-Id: Iea7dcb1fdae955615345aa835dc0b1a67840f39d Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
parent
e13b0cc4a0
commit
fa83803119
@ -66,6 +66,8 @@
|
|||||||
#include "qscreen.h"
|
#include "qscreen.h"
|
||||||
#include "qcursor.h"
|
#include "qcursor.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
//////////// QWellArray BEGIN
|
//////////// QWellArray BEGIN
|
||||||
@ -758,13 +760,9 @@ void QColorLuminancePicker::paintEvent(QPaintEvent *)
|
|||||||
int y;
|
int y;
|
||||||
uint *pixel = (uint *) img.scanLine(0);
|
uint *pixel = (uint *) img.scanLine(0);
|
||||||
for (y = 0; y < hi; y++) {
|
for (y = 0; y < hi; y++) {
|
||||||
const uint *end = pixel + wi;
|
uint *end = pixel + wi;
|
||||||
while (pixel < end) {
|
std::fill(pixel, end, QColor::fromHsv(hue, sat, y2val(y + coff)).rgb());
|
||||||
QColor c;
|
pixel = end;
|
||||||
c.setHsv(hue, sat, y2val(y+coff));
|
|
||||||
*pixel = c.rgb();
|
|
||||||
++pixel;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
pix = new QPixmap(QPixmap::fromImage(img));
|
pix = new QPixmap(QPixmap::fromImage(img));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user