diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-04-05 09:02:28 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-04-05 07:39:25 +0000 |
commit | 4e24bb24a234ee85fca25f9a117de7380083f593 (patch) | |
tree | 467b2a529f3b93f8a9c500c2aeb466b753f57bed | |
parent | b404cd930e32520f8ad62088c9ed31f33ce95933 (diff) |
Remove noisy warning for undefined QGradient preset
This runtime warning was recently introduced in the fix for an
assert/crash when creating a brush with an invalid Preset
value. However, that overlooked the usage where an unknown value is
passed to QGradient constructor, and the code afterwards checks if
the result is a NoGradient or not. It turns out that such usage is
already established as legitimate, including in the Qt Quick Rectangle
code, so this warning would be spit out continuously for perfectly
legal qml code.
Change-Id: Id60aed0817da0214b6cf17edd245f67e26470413
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/gui/painting/qbrush.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index bcc23fa683..d071f665bb 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -1378,10 +1378,8 @@ QGradient::QGradient(Preset preset) }(); const QJsonValue presetData = jsonPresets[preset - 1]; - if (!presetData.isObject()) { - qWarning("QGradient: Undefined preset %i", preset); + if (!presetData.isObject()) return; - } m_type = LinearGradient; setCoordinateMode(ObjectMode); |