From 4e24bb24a234ee85fca25f9a117de7380083f593 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 5 Apr 2019 09:02:28 +0200 Subject: 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 --- src/gui/painting/qbrush.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/gui/painting/qbrush.cpp') 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); -- cgit v1.2.3