summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/theme/q3dtheme_p.h
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-07 10:46:26 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-07 13:18:41 +0200
commit8566d712a87d9e3a78be15b6bd3498c2cf8afe57 (patch)
tree6ae292f0fd8c870d997db6d208a531da5f9320f0 /src/datavisualization/theme/q3dtheme_p.h
parentaa842c39480aa5b95f704c97b8b3acc821144883 (diff)
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 <mika.salmela@digia.com>
Diffstat (limited to 'src/datavisualization/theme/q3dtheme_p.h')
-rw-r--r--src/datavisualization/theme/q3dtheme_p.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/datavisualization/theme/q3dtheme_p.h b/src/datavisualization/theme/q3dtheme_p.h
index 24994854..078c2d7d 100644
--- a/src/datavisualization/theme/q3dtheme_p.h
+++ b/src/datavisualization/theme/q3dtheme_p.h
@@ -85,12 +85,11 @@ struct Q3DThemeDirtyBitField {
}
};
-class Q3DThemePrivate : public QObject
+class QT_DATAVISUALIZATION_EXPORT Q3DThemePrivate : public QObject
{
Q_OBJECT
public:
- Q3DThemePrivate(Q3DTheme *q,
- Q3DTheme::Theme theme_id = Q3DTheme::ThemeUserDefined);
+ Q3DThemePrivate(Q3DTheme *q);
virtual ~Q3DThemePrivate();
void resetDirtyBits();
@@ -100,6 +99,15 @@ public:
inline bool isDefaultTheme() { return m_isDefaultTheme; }
inline void setDefaultTheme(bool isDefault) { m_isDefaultTheme = isDefault; }
+ // If m_forcePredefinedType is true, it means we should forcibly update all properties
+ // of the theme to those of the predefined theme, when setting the theme type. Otherwise
+ // we only change the properties that haven't been explicitly changed since last render cycle.
+ // Defaults to true, and is only ever set to false by DeclarativeTheme3D to enable using
+ // predefined themes as base for custom themes, since the order of initial property sets cannot
+ // be easily controlled in QML.
+ inline bool isForcePredefinedType() { return m_forcePredefinedType; }
+ inline void setForcePredefinedType(bool enable) { m_forcePredefinedType = enable; }
+
signals:
void needRender();
@@ -130,6 +138,7 @@ public:
bool m_gridEnabled;
bool m_labelBackground;
bool m_isDefaultTheme;
+ bool m_forcePredefinedType;
protected:
Q3DTheme *q_ptr;