From 8566d712a87d9e3a78be15b6bd3498c2cf8afe57 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 7 Jan 2014 10:46:26 +0200 Subject: Fix setting theme type Now reset the theme properties immediately to new theme type, instead of waiting for the theme activation. Also make changing theme type later work consistently. Task-number: QTRD-2750 Change-Id: I970d69587623119df33ad2a825fbc12367804eae Reviewed-by: Mika Salmela --- src/datavisualizationqml2/declarativetheme.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/datavisualizationqml2/declarativetheme.cpp') diff --git a/src/datavisualizationqml2/declarativetheme.cpp b/src/datavisualizationqml2/declarativetheme.cpp index 6c804397..c494052a 100644 --- a/src/datavisualizationqml2/declarativetheme.cpp +++ b/src/datavisualizationqml2/declarativetheme.cpp @@ -150,6 +150,19 @@ ColorGradient *DeclarativeTheme3D::multiHighlightGradient() const return m_multiHLGradient; } +void DeclarativeTheme3D::classBegin() +{ + // Turn off predefined type forcing for the duration of initial class construction + // so that predefined type customization can be done. + d_ptr->setForcePredefinedType(false); +} + +void DeclarativeTheme3D::componentComplete() +{ + d_ptr->setForcePredefinedType(true); +} + + void DeclarativeTheme3D::setThemeGradient(ColorGradient *gradient, GradientType type) { QLinearGradient newGradient = convertGradient(gradient); @@ -217,7 +230,7 @@ void DeclarativeTheme3D::addColor(DeclarativeColor *color) QList DeclarativeTheme3D::colorList() { if (m_colors.isEmpty()) { - // Create dummy ThemeColors from theme's gradients + // Create dummy ThemeColors from theme's colors m_dummyColors = true; QList list = Q3DTheme::baseColors(); foreach (QColor item, list) { -- cgit v1.2.3