summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/theme/q3dtheme.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-11-28 06:40:59 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-11-28 08:10:29 +0200
commit5fde532408da5b6b3ddef13aff5e07f32015e7d9 (patch)
tree8a243126c37a92be3ca14734adc5074a9642c129 /src/datavisualization/theme/q3dtheme.cpp
parent964897e316c0fd524cba3a3cbb3c32fad53f965a (diff)
Visual properties moved to theme
Task-number: QTRD-2632 Change-Id: I91eaa8fa26e232de24fe89ef0c8a2fc53f31fb8c Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/theme/q3dtheme.cpp')
-rw-r--r--src/datavisualization/theme/q3dtheme.cpp99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/datavisualization/theme/q3dtheme.cpp b/src/datavisualization/theme/q3dtheme.cpp
index e43eb52d..dccaee91 100644
--- a/src/datavisualization/theme/q3dtheme.cpp
+++ b/src/datavisualization/theme/q3dtheme.cpp
@@ -271,6 +271,62 @@ bool Q3DTheme::isLabelBorderEnabled() const
return d_ptr->m_labelBorders;
}
+void Q3DTheme::setFont(const QFont &font)
+{
+ if (d_ptr->m_font != font) {
+ d_ptr->m_dirtyBits.fontDirty = true;
+ d_ptr->m_font = font;
+ emit fontChanged(font);
+ }
+}
+
+QFont Q3DTheme::font() const
+{
+ return d_ptr->m_font;
+}
+
+void Q3DTheme::setBackgroundEnabled(bool enabled)
+{
+ if (d_ptr->m_backgoundEnabled != enabled) {
+ d_ptr->m_dirtyBits.backgroundEnabledDirty = true;
+ d_ptr->m_backgoundEnabled = enabled;
+ emit backgroundEnabledChanged(enabled);
+ }
+}
+
+bool Q3DTheme::isBackgroundEnabled() const
+{
+ return d_ptr->m_backgoundEnabled;
+}
+
+void Q3DTheme::setGridEnabled(bool enabled)
+{
+ if (d_ptr->m_gridEnabled != enabled) {
+ d_ptr->m_dirtyBits.gridEnabledDirty = true;
+ d_ptr->m_gridEnabled = enabled;
+ emit gridEnabledChanged(enabled);
+ }
+}
+
+bool Q3DTheme::isGridEnabled() const
+{
+ return d_ptr->m_gridEnabled;
+}
+
+void Q3DTheme::setLabelBackgroundEnabled(bool enabled)
+{
+ if (d_ptr->m_labelBackground != enabled) {
+ d_ptr->m_dirtyBits.labelBackgroundEnabledDirty = true;
+ d_ptr->m_labelBackground = enabled;
+ emit labelBackgroundEnabledChanged(enabled);
+ }
+}
+
+bool Q3DTheme::isLabelBackgroundEnabled() const
+{
+ return d_ptr->m_labelBackground;
+}
+
void Q3DTheme::setColorStyle(QDataVis::ColorStyle style)
{
if (d_ptr->m_colorStyle != style) {
@@ -303,6 +359,15 @@ QDataVis::Theme Q3DTheme::type() const
Q3DThemePrivate::Q3DThemePrivate(Q3DTheme *q, QDataVis::Theme theme_id)
: QObject(0),
m_themeId(theme_id),
+ m_baseColor(Qt::white),
+ m_backgroundColor(Qt::black),
+ m_windowColor(Qt::black),
+ m_textColor(Qt::white),
+ m_textBackgroundColor(Qt::gray),
+ m_gridLineColor(Qt::white),
+ m_singleHighlightColor(Qt::red),
+ m_multiHighlightColor(Qt::blue),
+ m_lightColor(Qt::white),
m_baseGradient(QLinearGradient(qreal(gradientTextureWidth),
qreal(gradientTextureHeight),
0.0, 0.0)),
@@ -312,6 +377,15 @@ Q3DThemePrivate::Q3DThemePrivate(Q3DTheme *q, QDataVis::Theme theme_id)
m_multiHighlightGradient(QLinearGradient(qreal(gradientTextureWidth),
qreal(gradientTextureHeight),
0.0, 0.0)),
+ m_lightStrength(0.5f),
+ m_ambientLightStrength(0.25f),
+ m_highlightLightStrength(0.75f),
+ m_labelBorders(true),
+ m_colorStyle(QDataVis::ColorStyleUniform),
+ m_font(QFont(QStringLiteral("Arial"))),
+ m_backgoundEnabled(true),
+ m_gridEnabled(true),
+ m_labelBackground(true),
q_ptr(q)
{
}
@@ -320,4 +394,29 @@ Q3DThemePrivate::~Q3DThemePrivate()
{
}
+void Q3DThemePrivate::resetDirtyBits()
+{
+ m_dirtyBits.ambientLightStrengthDirty = false;
+ m_dirtyBits.backgroundColorDirty = false;
+ m_dirtyBits.backgroundEnabledDirty = false;
+ m_dirtyBits.baseColorDirty = false;
+ m_dirtyBits.baseGradientDirty = false;
+ m_dirtyBits.colorStyleDirty = false;
+ m_dirtyBits.fontDirty = false;
+ m_dirtyBits.gridEnabledDirty = false;
+ m_dirtyBits.gridLineColorDirty = false;
+ m_dirtyBits.highlightLightStrengthDirty = false;
+ m_dirtyBits.labelBackgroundEnabledDirty = false;
+ m_dirtyBits.labelBorderEnabledDirty = false;
+ m_dirtyBits.lightColorDirty = false;
+ m_dirtyBits.lightStrengthDirty = false;
+ m_dirtyBits.multiHighlightColorDirty = false;
+ m_dirtyBits.multiHighlightGradientDirty = false;
+ m_dirtyBits.singleHighlightColorDirty = false;
+ m_dirtyBits.singleHighlightGradientDirty = false;
+ m_dirtyBits.textBackgroundColorDirty = false;
+ m_dirtyBits.textColorDirty = false;
+ m_dirtyBits.windowColorDirty = false;
+}
+
QT_DATAVISUALIZATION_END_NAMESPACE