diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-01-26 12:37:45 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-01-26 13:18:25 (GMT) |
commit | 88c1670a658d55257d50181d741afe562e44344b (patch) | |
tree | 3ecb9434f1ed79b358c475d5b6ca5d47e66be1e5 /tests/auto/qcolor | |
parent | 6ef6adb7d6ba8408772c11c6190bc12960435c79 (diff) | |
download | Qt-88c1670a658d55257d50181d741afe562e44344b.zip Qt-88c1670a658d55257d50181d741afe562e44344b.tar.gz Qt-88c1670a658d55257d50181d741afe562e44344b.tar.bz2 |
Fixed hslHue / hslHueF returning the wrong value for achromatic QColors.
Made toHsl() work the same way as toHsv(), ensuring the hue gets set to
USHRT_MAX and not 0.
Task-number: QTBUG-16530
Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'tests/auto/qcolor')
-rw-r--r-- | tests/auto/qcolor/tst_qcolor.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qcolor/tst_qcolor.cpp b/tests/auto/qcolor/tst_qcolor.cpp index fcd608b..d42c26c 100644 --- a/tests/auto/qcolor/tst_qcolor.cpp +++ b/tests/auto/qcolor/tst_qcolor.cpp @@ -148,6 +148,8 @@ private slots: void specConstructor_data(); void specConstructor(); + void achromaticHslHue(); + #ifdef Q_WS_X11 void allowX11ColorNames(); void setallowX11ColorNames(); @@ -1459,6 +1461,14 @@ void tst_QColor::specConstructor() QCOMPARE(color.spec(), spec); } +void tst_QColor::achromaticHslHue() +{ + QColor color = Qt::black; + + QColor hsl = color.toHsl(); + QCOMPARE(hsl.hslHue(), -1); +} + #ifdef Q_WS_X11 void tst_QColor::allowX11ColorNames() { |