diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2023-04-13 14:20:35 +0300 |
---|---|---|
committer | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2023-04-18 07:34:36 +0300 |
commit | 86665d774ec0e4efb46eec47fdc8297a3ff5d196 (patch) | |
tree | 7f974b66569c5a443657ddebf0971034c796668f /src/datavisualization/theme | |
parent | 63b27b664ea8a41420723e053830412068c6eefe (diff) |
Fix invalid value handling
Pick-to: 6.5
Fixes: QTBUG-112773
Change-Id: I3b00587d27e88dd69b58efe3551abf8759df0020
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/datavisualization/theme')
-rw-r--r-- | src/datavisualization/theme/q3dtheme.cpp | 12 | ||||
-rw-r--r-- | src/datavisualization/theme/q3dtheme.h | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/datavisualization/theme/q3dtheme.cpp b/src/datavisualization/theme/q3dtheme.cpp index 8832ad0d..39fe9dbc 100644 --- a/src/datavisualization/theme/q3dtheme.cpp +++ b/src/datavisualization/theme/q3dtheme.cpp @@ -996,11 +996,13 @@ Q3DTheme::ColorStyle Q3DTheme::colorStyle() const */ void Q3DTheme::setType(Theme themeType) { - d_ptr->m_dirtyBits.themeIdDirty = true; - if (d_ptr->m_themeId != themeType) { - d_ptr->m_themeId = themeType; - ThemeManager::setPredefinedPropertiesToTheme(this, themeType); - emit typeChanged(themeType); + if (themeType >= ThemeQt && themeType <= ThemeUserDefined) { + d_ptr->m_dirtyBits.themeIdDirty = true; + if (d_ptr->m_themeId != themeType) { + d_ptr->m_themeId = themeType; + ThemeManager::setPredefinedPropertiesToTheme(this, themeType); + emit typeChanged(themeType); + } } } diff --git a/src/datavisualization/theme/q3dtheme.h b/src/datavisualization/theme/q3dtheme.h index 3da755d1..5087d854 100644 --- a/src/datavisualization/theme/q3dtheme.h +++ b/src/datavisualization/theme/q3dtheme.h @@ -50,7 +50,7 @@ public: }; enum Theme { - ThemeQt, + ThemeQt = 0, ThemePrimaryColors, ThemeDigia, ThemeStoneMoss, |