diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-15 16:03:59 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-03-08 06:51:11 +0100 |
commit | a992f4b4c01883e34505e0eb4d03ee239fb839d1 (patch) | |
tree | f68937a52188bf6b7ae6c505743e1db008d15eb6 /src/gui/painting/qcolor.h | |
parent | 78b6876974d2cea087cb229257097052dad5fcf7 (diff) |
QColor: remove setColorFromString()
This private method doubled as the implementation of both fromString()
and isValidColorName(). By reformulating isValidColorName() as
fromString().isValid(), we can then turn setColorFromString() into
fromString(), by returning the data, instead of setting it on *this
through use of exported functions.
Since we need to touch the if's anyway, to remove braces, use C++17
if-with-initializer to turn the second if into an else-of, saving one
return {}.
Change-Id: If3f8182a40c0c6d6ad514431b5870e69d0e95769
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/painting/qcolor.h')
-rw-r--r-- | src/gui/painting/qcolor.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index a2ff932460..5bb4da87cf 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -231,7 +231,6 @@ public: private: void invalidate() noexcept; - bool setColorFromString(QAnyStringView) noexcept; static constexpr bool isRgbaValid(int r, int g, int b, int a = 255) noexcept Q_DECL_CONST_FUNCTION { |