summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-28 16:53:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-29 08:22:36 +0100
commitfa83803119296c2224cf1c7fb7474057a77aa51b (patch)
tree2dfed17fa5eba3706ca0c9653de1b53d997194c4 /src
parente13b0cc4a08871af0fd4414f63d466712e0105d2 (diff)
QColorDialog: Streamline painting code of QColorLuminancePicker.
Task-number: QTBUG-36078 Change-Id: Iea7dcb1fdae955615345aa835dc0b1a67840f39d Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index bae49313ac..9323e84599 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -66,6 +66,8 @@
#include "qscreen.h"
#include "qcursor.h"
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
//////////// QWellArray BEGIN
@@ -758,13 +760,9 @@ void QColorLuminancePicker::paintEvent(QPaintEvent *)
int y;
uint *pixel = (uint *) img.scanLine(0);
for (y = 0; y < hi; y++) {
- const uint *end = pixel + wi;
- while (pixel < end) {
- QColor c;
- c.setHsv(hue, sat, y2val(y+coff));
- *pixel = c.rgb();
- ++pixel;
- }
+ uint *end = pixel + wi;
+ std::fill(pixel, end, QColor::fromHsv(hue, sat, y2val(y + coff)).rgb());
+ pixel = end;
}
pix = new QPixmap(QPixmap::fromImage(img));
}