From 3ce4ae10e54e9c5d73826f4d6f8c5e442ac2d525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 22 Nov 2013 07:56:04 +0200 Subject: User-modifiable themes, part 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTRD-2120 + old functionality remade - new functionality to be added + fixed a compilation error in qbarseries for mingw Change-Id: I710c97b5d4023861be8e8cc5cc61c05bb4644964 Signed-off-by: Tomi Korpipää --- src/datavisualization/theme/builtin3dthemes.cpp | 230 ++++++++++++++++++ src/datavisualization/theme/builtin3dthemes_p.h | 87 +++++++ src/datavisualization/theme/q3dtheme.cpp | 306 +++++++++++++++++++++++ src/datavisualization/theme/q3dtheme.h | 145 +++++++++++ src/datavisualization/theme/q3dtheme_p.h | 77 ++++++ src/datavisualization/theme/theme.pri | 8 + src/datavisualization/theme/thememanager.cpp | 307 ++++++++++++++++++++++++ src/datavisualization/theme/thememanager_p.h | 59 +++++ 8 files changed, 1219 insertions(+) create mode 100644 src/datavisualization/theme/builtin3dthemes.cpp create mode 100644 src/datavisualization/theme/builtin3dthemes_p.h create mode 100644 src/datavisualization/theme/q3dtheme.cpp create mode 100644 src/datavisualization/theme/q3dtheme.h create mode 100644 src/datavisualization/theme/q3dtheme_p.h create mode 100644 src/datavisualization/theme/theme.pri create mode 100644 src/datavisualization/theme/thememanager.cpp create mode 100644 src/datavisualization/theme/thememanager_p.h (limited to 'src/datavisualization/theme') diff --git a/src/datavisualization/theme/builtin3dthemes.cpp b/src/datavisualization/theme/builtin3dthemes.cpp new file mode 100644 index 00000000..9848e6e5 --- /dev/null +++ b/src/datavisualization/theme/builtin3dthemes.cpp @@ -0,0 +1,230 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#include "builtin3dthemes_p.h" + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +BuiltIn3DThemeQt::BuiltIn3DThemeQt() + : Q3DTheme(QDataVis::ThemeQt) +{ + setBaseColor(QColor(QRgb(0x80c342))); + setBackgroundColor(QColor(QRgb(0xffffff))); + setWindowColor(QColor(QRgb(0xffffff))); + setTextColor(QColor(QRgb(0x35322f))); + setTextBackgroundColor(QColor(0xff, 0xff, 0xff, 0x99)); + setGridLineColor(QColor(QRgb(0xd7d6d5))); + setSingleHighlightColor(QColor(QRgb(0x14aaff))); + setMultiHighlightColor(QColor(QRgb(0x6400aa))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(true); + setColorStyle(QDataVis::ColorStyleUniform); +} + +BuiltIn3DThemePrimaryColors::BuiltIn3DThemePrimaryColors() + : Q3DTheme(QDataVis::ThemePrimaryColors) +{ + setBaseColor(QColor(QRgb(0xffe400))); + setBackgroundColor(QColor(QRgb(0xffffff))); + setWindowColor(QColor(QRgb(0xffffff))); + setTextColor(QColor(QRgb(0x000000))); + setTextBackgroundColor(QColor(0xff, 0xff, 0xff, 0x99)); + setGridLineColor(QColor(QRgb(0xd7d6d5))); + setSingleHighlightColor(QColor(QRgb(0x27beee))); + setMultiHighlightColor(QColor(QRgb(0xee1414))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(false); + setColorStyle(QDataVis::ColorStyleUniform); +} + +BuiltIn3DThemeDigia::BuiltIn3DThemeDigia() + : Q3DTheme(QDataVis::ThemeDigia) +{ + setBackgroundColor(QColor(QRgb(0xffffff))); + setWindowColor(QColor(QRgb(0xffffff))); + setTextColor(QColor(QRgb(0x000000))); + setTextBackgroundColor(QColor(0xff, 0xff, 0xff, 0x80)); + setGridLineColor(QColor(QRgb(0xd7d6d5))); + setSingleHighlightColor(QColor(QRgb(0xfa0000))); + setMultiHighlightColor(QColor(QRgb(0x555555))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(false); + setColorStyle(QDataVis::ColorStyleObjectGradient); + QLinearGradient gradient = QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0); + QColor color; + color.setRed(0xcc * 0.7); + color.setGreen(0xcc * 0.7); + color.setBlue(0xcc * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0xcccccc))); + setBaseGradient(gradient); + color.setRed(0xfa * 0.7); + color.setGreen(0x00); + color.setBlue(0x00); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0xfa0000))); + setSingleHighlightGradient(gradient); + color.setRed(0x55 * 0.7); + color.setGreen(0x55 * 0.7); + color.setBlue(0x55 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x555555))); + setMultiHighlightGradient(gradient); +} + +BuiltIn3DThemeStoneMoss::BuiltIn3DThemeStoneMoss() + : Q3DTheme(QDataVis::ThemeStoneMoss) +{ + setBaseColor(QColor(QRgb(0xbeb32b))); + setBackgroundColor(QColor(QRgb(0x4d4d4f))); + setWindowColor(QColor(QRgb(0x4d4d4f))); + setTextColor(QColor(QRgb(0xffffff))); + setTextBackgroundColor(QColor(0x4d, 0x4d, 0x4f, 0xcd)); + setGridLineColor(QColor(QRgb(0x3e3e40))); + setSingleHighlightColor(QColor(QRgb(0xfbf6d6))); + setMultiHighlightColor(QColor(QRgb(0x442f20))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(true); + setColorStyle(QDataVis::ColorStyleUniform); +} + +BuiltIn3DThemeArmyBlue::BuiltIn3DThemeArmyBlue() + : Q3DTheme(QDataVis::ThemeArmyBlue) +{ + setBackgroundColor(QColor(QRgb(0xd5d6d7))); + setWindowColor(QColor(QRgb(0xd5d6d7))); + setTextColor(QColor(QRgb(0x000000))); + setTextBackgroundColor(QColor(0xd5, 0xd6, 0xd7, 0xcd)); + setGridLineColor(QColor(QRgb(0xaeadac))); + setSingleHighlightColor(QColor(QRgb(0x2aa2f9))); + setMultiHighlightColor(QColor(QRgb(0x103753))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(false); + setColorStyle(QDataVis::ColorStyleObjectGradient); + QLinearGradient gradient = QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0); + QColor color; + color.setRed(0x49 * 0.7); + color.setGreen(0x5f * 0.7); + color.setBlue(0x76 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x495f76))); + setBaseGradient(gradient); + color.setRed(0x2a * 0.7); + color.setGreen(0xa2 * 0.7); + color.setBlue(0xf9 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x2aa2f9))); + setSingleHighlightGradient(gradient); + color.setRed(0x10 * 0.7); + color.setGreen(0x37 * 0.7); + color.setBlue(0x53 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x103753))); + setMultiHighlightGradient(gradient); +} + +BuiltIn3DThemeRetro::BuiltIn3DThemeRetro() + : Q3DTheme(QDataVis::ThemeRetro) +{ + setBackgroundColor(QColor(QRgb(0xe9e2ce))); + setWindowColor(QColor(QRgb(0xe9e2ce))); + setTextColor(QColor(QRgb(0x000000))); + setTextBackgroundColor(QColor(0xe9, 0xe2, 0xce, 0xc0)); + setGridLineColor(QColor(QRgb(0xd0c0b0))); + setSingleHighlightColor(QColor(QRgb(0x8ea317))); + setMultiHighlightColor(QColor(QRgb(0xc25708))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(false); + setColorStyle(QDataVis::ColorStyleObjectGradient); + QLinearGradient gradient = QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0); + QColor color; + color.setRed(0x53 * 0.7); + color.setGreen(0x3b * 0.7); + color.setBlue(0x23 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x533b23))); + setBaseGradient(gradient); + color.setRed(0x8e * 0.7); + color.setGreen(0xa3 * 0.7); + color.setBlue(0x17 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x8ea317))); + setSingleHighlightGradient(gradient); + color.setRed(0xc2 * 0.7); + color.setGreen(0x57 * 0.7); + color.setBlue(0x08 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0xc25708))); + setMultiHighlightGradient(gradient); +} + +BuiltIn3DThemeEbony::BuiltIn3DThemeEbony() + : Q3DTheme(QDataVis::ThemeEbony) +{ + setBaseColor(QColor(QRgb(0xffffff))); + setBackgroundColor(QColor(QRgb(0x000000))); + setWindowColor(QColor(QRgb(0x000000))); + setTextColor(QColor(QRgb(0xaeadac))); + setTextBackgroundColor(QColor(0x00, 0x00, 0x00, 0xcd)); + setGridLineColor(QColor(QRgb(0x35322f))); + setSingleHighlightColor(QColor(QRgb(0xf5dc0d))); + setMultiHighlightColor(QColor(QRgb(0xd72222))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(false); + setColorStyle(QDataVis::ColorStyleUniform); +} + +BuiltIn3DThemeIsabelle::BuiltIn3DThemeIsabelle() + : Q3DTheme(QDataVis::ThemeIsabelle) +{ + setBaseColor(QColor(QRgb(0xf9d900))); + setBackgroundColor(QColor(QRgb(0x000000))); + setWindowColor(QColor(QRgb(0x000000))); + setTextColor(QColor(QRgb(0xaeadac))); + setTextBackgroundColor(QColor(0x00, 0x00, 0x00, 0xc0)); + setGridLineColor(QColor(QRgb(0x35322f))); + setSingleHighlightColor(QColor(QRgb(0xfff7cc))); + setMultiHighlightColor(QColor(QRgb(0xde0a0a))); + setLightStrength(5.0f); + setAmbientLightStrength(0.5f); + setHighlightLightStrength(5.0f); + setLabelBorderEnabled(false); + setColorStyle(QDataVis::ColorStyleUniform); +} + +QT_DATAVISUALIZATION_END_NAMESPACE diff --git a/src/datavisualization/theme/builtin3dthemes_p.h b/src/datavisualization/theme/builtin3dthemes_p.h new file mode 100644 index 00000000..8f2c3d04 --- /dev/null +++ b/src/datavisualization/theme/builtin3dthemes_p.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QtDataVisualization API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef BUILTIN3DTHEMES_P_H +#define BUILTIN3DTHEMES_P_H + +#include "datavisualizationglobal_p.h" +#include "q3dtheme_p.h" + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +class BuiltIn3DThemeQt : public Q3DTheme +{ +public: + BuiltIn3DThemeQt(); +}; + +class BuiltIn3DThemePrimaryColors : public Q3DTheme +{ +public: + BuiltIn3DThemePrimaryColors(); +}; + +class BuiltIn3DThemeDigia : public Q3DTheme +{ +public: + BuiltIn3DThemeDigia(); +}; + +class BuiltIn3DThemeStoneMoss : public Q3DTheme +{ +public: + BuiltIn3DThemeStoneMoss(); +}; + +class BuiltIn3DThemeArmyBlue : public Q3DTheme +{ +public: + BuiltIn3DThemeArmyBlue(); +}; + +class BuiltIn3DThemeRetro : public Q3DTheme +{ +public: + BuiltIn3DThemeRetro(); +}; + +class BuiltIn3DThemeEbony : public Q3DTheme +{ +public: + BuiltIn3DThemeEbony(); +}; + +class BuiltIn3DThemeIsabelle : public Q3DTheme +{ +public: + BuiltIn3DThemeIsabelle(); +}; + +QT_DATAVISUALIZATION_END_NAMESPACE + +#endif diff --git a/src/datavisualization/theme/q3dtheme.cpp b/src/datavisualization/theme/q3dtheme.cpp new file mode 100644 index 00000000..8aba6b48 --- /dev/null +++ b/src/datavisualization/theme/q3dtheme.cpp @@ -0,0 +1,306 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#include "q3dtheme_p.h" + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +Q3DTheme::Q3DTheme(QObject *parent) + : QObject(parent), + d_ptr(new Q3DThemePrivate(this, QDataVis::ThemeUserDefined)) +{ +} + +Q3DTheme::Q3DTheme(QDataVis::Theme themeType, QObject *parent) + : QObject(parent), + d_ptr(new Q3DThemePrivate(this, themeType)) +{ +} + +Q3DTheme::Q3DTheme(Q3DThemePrivate *d, QDataVis::Theme themeType, + QObject *parent) : + QObject(parent), + d_ptr(d) +{ + d_ptr->m_themeId = themeType; +} + +Q3DTheme::~Q3DTheme() +{ + +} + +// TODO: Basecolors as a list, containing one for each series? +void Q3DTheme::setBaseColor(const QColor &color) +{ + if (d_ptr->m_baseColor != color) { + d_ptr->m_baseColor = color; + emit baseColorChanged(color); + } +} + +QColor Q3DTheme::baseColor() const +{ + return d_ptr->m_baseColor; +} + +void Q3DTheme::setBackgroundColor(const QColor &color) +{ + if (d_ptr->m_backgroundColor != color) { + d_ptr->m_backgroundColor = color; + emit backgroundColorChanged(color); + } +} + +QColor Q3DTheme::backgroundColor() const +{ + return d_ptr->m_backgroundColor; +} + +void Q3DTheme::setWindowColor(const QColor &color) +{ + if (d_ptr->m_windowColor != color) { + d_ptr->m_windowColor = color; + emit windowColorChanged(color); + } +} + +QColor Q3DTheme::windowColor() const +{ + return d_ptr->m_windowColor; +} + +void Q3DTheme::setTextColor(const QColor &color) +{ + if (d_ptr->m_textColor != color) { + d_ptr->m_textColor = color; + emit textColorChanged(color); + } +} + +QColor Q3DTheme::textColor() const +{ + return d_ptr->m_textColor; +} + +void Q3DTheme::setTextBackgroundColor(const QColor &color) +{ + if (d_ptr->m_textBackgroundColor != color) { + d_ptr->m_textBackgroundColor = color; + emit textBackgroundColorChanged(color); + } +} + +QColor Q3DTheme::textBackgroundColor() const +{ + return d_ptr->m_textBackgroundColor; +} + +void Q3DTheme::setGridLineColor(const QColor &color) +{ + if (d_ptr->m_gridLineColor != color) { + d_ptr->m_gridLineColor = color; + emit gridLineColorChanged(color); + } +} + +QColor Q3DTheme::gridLineColor() const +{ + return d_ptr->m_gridLineColor; +} + +void Q3DTheme::setSingleHighlightColor(const QColor &color) +{ + if (d_ptr->m_singleHighlightColor != color) { + d_ptr->m_singleHighlightColor = color; + emit singleHighlightColorChanged(color); + } +} + +QColor Q3DTheme::singleHighlightColor() const +{ + return d_ptr->m_singleHighlightColor; +} + +void Q3DTheme::setMultiHighlightColor(const QColor &color) +{ + if (d_ptr->m_multiHighlightColor != color) { + d_ptr->m_multiHighlightColor = color; + emit multiHighlightColorChanged(color); + } +} + +QColor Q3DTheme::multiHighlightColor() const +{ + return d_ptr->m_multiHighlightColor; +} + +void Q3DTheme::setLightColor(const QColor &color) +{ + if (d_ptr->m_lightColor != color) { + d_ptr->m_lightColor = color; + emit lightColorChanged(color); + } +} + +QColor Q3DTheme::lightColor() const +{ + return d_ptr->m_lightColor; +} + +// TODO: Surfacegradients as a list, containing one for each series? +void Q3DTheme::setBaseGradient(const QLinearGradient &gradient) +{ + if (d_ptr->m_baseGradient != gradient) { + d_ptr->m_baseGradient = gradient; + emit baseGradientChanged(gradient); + } +} + +QLinearGradient Q3DTheme::baseGradient() const +{ + return d_ptr->m_baseGradient; +} + +void Q3DTheme::setSingleHighlightGradient(const QLinearGradient &gradient) +{ + if (d_ptr->m_singleHighlightGradient != gradient) { + d_ptr->m_singleHighlightGradient = gradient; + emit singleHighlightGradientChanged(gradient); + } +} + +QLinearGradient Q3DTheme::singleHighlightGradient() const +{ + return d_ptr->m_singleHighlightGradient; +} + +void Q3DTheme::setMultiHighlightGradient(const QLinearGradient &gradient) +{ + if (d_ptr->m_multiHighlightGradient != gradient) { + d_ptr->m_multiHighlightGradient = gradient; + emit multiHighlightGradientChanged(gradient); + } +} + +QLinearGradient Q3DTheme::multiHighlightGradient() const +{ + return d_ptr->m_multiHighlightGradient; +} + +void Q3DTheme::setLightStrength(float strength) +{ + if (d_ptr->m_lightStrength != strength) { + d_ptr->m_lightStrength = strength; + emit lightStrengthChanged(strength); + } +} + +float Q3DTheme::lightStrength() const +{ + return d_ptr->m_lightStrength; +} + +void Q3DTheme::setAmbientLightStrength(float strength) +{ + if (d_ptr->m_ambientLightStrength != strength) { + d_ptr->m_ambientLightStrength = strength; + emit ambientLightStrengthChanged(strength); + } +} + +float Q3DTheme::ambientLightStrength() const +{ + return d_ptr->m_ambientLightStrength; +} + +void Q3DTheme::setHighlightLightStrength(float strength) +{ + if (d_ptr->m_highlightLightStrength != strength) { + d_ptr->m_highlightLightStrength = strength; + emit highlightLightStrengthChanged(strength); + } +} + +float Q3DTheme::highlightLightStrength() const +{ + return d_ptr->m_highlightLightStrength; +} + +void Q3DTheme::setLabelBorderEnabled(bool enabled) +{ + if (d_ptr->m_labelBorders != enabled) { + d_ptr->m_labelBorders = enabled; + emit labelBorderEnabledChanged(enabled); + } +} + +bool Q3DTheme::isLabelBorderEnabled() const +{ + return d_ptr->m_labelBorders; +} + +void Q3DTheme::setColorStyle(QDataVis::ColorStyle style) +{ + if (d_ptr->m_colorStyle != style) { + d_ptr->m_colorStyle = style; + emit colorStyleChanged(style); + } +} + +QDataVis::ColorStyle Q3DTheme::colorStyle() const +{ + return d_ptr->m_colorStyle; +} + +void Q3DTheme::setType(QDataVis::Theme themeType) +{ + if (d_ptr->m_themeId != themeType) { + d_ptr->m_themeId = themeType; + emit typeChanged(themeType); + } +} + +QDataVis::Theme Q3DTheme::type() const +{ + return d_ptr->m_themeId; +} + +// Q3DThemePrivate + +Q3DThemePrivate::Q3DThemePrivate(Q3DTheme *q, QDataVis::Theme theme_id) + : QObject(0), + m_themeId(theme_id), + m_baseGradient(QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0)), + m_singleHighlightGradient(QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0)), + m_multiHighlightGradient(QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0)), + q_ptr(q) +{ +} + +Q3DThemePrivate::~Q3DThemePrivate() +{ +} + +QT_DATAVISUALIZATION_END_NAMESPACE diff --git a/src/datavisualization/theme/q3dtheme.h b/src/datavisualization/theme/q3dtheme.h new file mode 100644 index 00000000..8d42e6cf --- /dev/null +++ b/src/datavisualization/theme/q3dtheme.h @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#ifndef Q3DTHEME_H +#define Q3DTHEME_H + +#include +#include + +class QColor; + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +class Q3DThemePrivate; + +class QT_DATAVISUALIZATION_EXPORT Q3DTheme : public QObject +{ + Q_OBJECT + Q_PROPERTY(QtDataVisualization::QDataVis::Theme type READ type WRITE setType NOTIFY typeChanged) + Q_PROPERTY(QColor baseColor READ baseColor WRITE setBaseColor NOTIFY baseColorChanged) + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) + Q_PROPERTY(QColor windowColor READ windowColor WRITE setWindowColor NOTIFY windowColorChanged) + Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged) + Q_PROPERTY(QColor textBackgroundColor READ textBackgroundColor WRITE setTextBackgroundColor NOTIFY textBackgroundColorChanged) + Q_PROPERTY(QColor gridLineColor READ gridLineColor WRITE setGridLineColor NOTIFY gridLineColorChanged) + Q_PROPERTY(QColor singleHighlightColor READ singleHighlightColor WRITE setSingleHighlightColor NOTIFY singleHighlightColorChanged) + Q_PROPERTY(QColor multiHighlightColor READ multiHighlightColor WRITE setMultiHighlightColor NOTIFY multiHighlightColorChanged) + Q_PROPERTY(QColor lightColor READ lightColor WRITE setLightColor NOTIFY lightColorChanged) // TODO: Not used yet + Q_PROPERTY(QLinearGradient baseGradient READ baseGradient WRITE setBaseGradient NOTIFY baseGradientChanged) + Q_PROPERTY(QLinearGradient singleHighlightGradient READ singleHighlightGradient WRITE setSingleHighlightGradient NOTIFY singleHighlightGradientChanged) + Q_PROPERTY(QLinearGradient multiHighlightGradient READ multiHighlightGradient WRITE setMultiHighlightGradient NOTIFY multiHighlightGradientChanged) + Q_PROPERTY(float lightStrength READ lightStrength WRITE setLightStrength NOTIFY lightStrengthChanged) + Q_PROPERTY(float ambientLightStrength READ ambientLightStrength WRITE setAmbientLightStrength NOTIFY ambientLightStrengthChanged) + Q_PROPERTY(float highlightLightStrength READ highlightLightStrength WRITE setHighlightLightStrength NOTIFY highlightLightStrengthChanged) + Q_PROPERTY(bool labelBorderEnabled READ isLabelBorderEnabled WRITE setLabelBorderEnabled NOTIFY labelBorderEnabledChanged) + Q_PROPERTY(QtDataVisualization::QDataVis::ColorStyle colorStyle READ colorStyle WRITE setColorStyle NOTIFY colorStyleChanged) + // TODO: Add everything that we need + +public: + explicit Q3DTheme(QObject *parent = 0); + explicit Q3DTheme(QDataVis::Theme themeType, QObject *parent = 0); + virtual ~Q3DTheme(); + + void setType(QDataVis::Theme themeType); + QDataVis::Theme type() const; + + void setBaseColor(const QColor &color); + QColor baseColor() const; + + void setBackgroundColor(const QColor &color); + QColor backgroundColor() const; + + void setWindowColor(const QColor &color); + QColor windowColor() const; + + void setTextColor(const QColor &color); + QColor textColor() const; + + void setTextBackgroundColor(const QColor &color); + QColor textBackgroundColor() const; + + void setGridLineColor(const QColor &color); + QColor gridLineColor() const; + + void setSingleHighlightColor(const QColor &color); + QColor singleHighlightColor() const; + + void setMultiHighlightColor(const QColor &color); + QColor multiHighlightColor() const; + + void setLightColor(const QColor &color); + QColor lightColor() const; + + void setBaseGradient(const QLinearGradient &gradient); + QLinearGradient baseGradient() const; + + void setSingleHighlightGradient(const QLinearGradient &gradient); + QLinearGradient singleHighlightGradient() const; + + void setMultiHighlightGradient(const QLinearGradient &gradient); + QLinearGradient multiHighlightGradient() const; + + void setLightStrength(float strength); + float lightStrength() const; + + void setAmbientLightStrength(float strength); + float ambientLightStrength() const; + + void setHighlightLightStrength(float strength); + float highlightLightStrength() const; + + void setLabelBorderEnabled(bool enabled); + bool isLabelBorderEnabled() const; + + void setColorStyle(QDataVis::ColorStyle style); + QDataVis::ColorStyle colorStyle() const; + +signals: + void typeChanged(QDataVis::Theme themeType); + void baseColorChanged(QColor color); + void backgroundColorChanged(QColor color); + void windowColorChanged(QColor color); + void textColorChanged(QColor color); + void textBackgroundColorChanged(QColor color); + void gridLineColorChanged(QColor color); + void singleHighlightColorChanged(QColor color); + void multiHighlightColorChanged(QColor color); + void lightColorChanged(QColor color); + void baseGradientChanged(QLinearGradient gradient); + void singleHighlightGradientChanged(QLinearGradient gradient); + void multiHighlightGradientChanged(QLinearGradient gradient); + void lightStrengthChanged(float strength); + void ambientLightStrengthChanged(float strength); + void highlightLightStrengthChanged(float strength); + void labelBorderEnabledChanged(bool enabled); + void colorStyleChanged(QDataVis::ColorStyle style); + +protected: + explicit Q3DTheme(Q3DThemePrivate *d, + QDataVis::Theme themeType, + QObject *parent = 0); + QScopedPointer d_ptr; + +private: + Q_DISABLE_COPY(Q3DTheme) +}; + +QT_DATAVISUALIZATION_END_NAMESPACE + +#endif diff --git a/src/datavisualization/theme/q3dtheme_p.h b/src/datavisualization/theme/q3dtheme_p.h new file mode 100644 index 00000000..ae4bdbe4 --- /dev/null +++ b/src/datavisualization/theme/q3dtheme_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QtDataVisualization API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef Q3DTHEME_P_H +#define Q3DTHEME_P_H + +#include "datavisualizationglobal_p.h" +#include "q3dtheme.h" + +class QColor; +class QLinearGradient; + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +class Q3DThemePrivate : public QObject +{ + Q_OBJECT +public: + Q3DThemePrivate(Q3DTheme *q, + QDataVis::Theme theme_id = QDataVis::ThemeUserDefined); + virtual ~Q3DThemePrivate(); + +public: + QDataVis::Theme m_themeId; + + QColor m_baseColor; + QColor m_heightColor; + QColor m_depthColor; + QColor m_backgroundColor; + QColor m_windowColor; + QColor m_textColor; + QColor m_textBackgroundColor; + QColor m_gridLineColor; + QColor m_singleHighlightColor; + QColor m_multiHighlightColor; + QColor m_lightColor; + QLinearGradient m_baseGradient; + QLinearGradient m_singleHighlightGradient; + QLinearGradient m_multiHighlightGradient; + float m_lightStrength; + float m_ambientLightStrength; + float m_highlightLightStrength; + bool m_labelBorders; + QDataVis::ColorStyle m_colorStyle; + +protected: + Q3DTheme *q_ptr; +}; + +QT_DATAVISUALIZATION_END_NAMESPACE + +#endif diff --git a/src/datavisualization/theme/theme.pri b/src/datavisualization/theme/theme.pri new file mode 100644 index 00000000..1de3035a --- /dev/null +++ b/src/datavisualization/theme/theme.pri @@ -0,0 +1,8 @@ +HEADERS += \ + $$PWD/q3dtheme.h \ + $$PWD/q3dtheme_p.h \ + $$PWD/thememanager_p.h + +SOURCES += \ + $$PWD/q3dtheme.cpp \ + $$PWD/thememanager.cpp diff --git a/src/datavisualization/theme/thememanager.cpp b/src/datavisualization/theme/thememanager.cpp new file mode 100644 index 00000000..57682958 --- /dev/null +++ b/src/datavisualization/theme/thememanager.cpp @@ -0,0 +1,307 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#include "thememanager_p.h" + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +ThemeManager::ThemeManager(Abstract3DController *controller) + : m_theme(0), + m_controller(controller) +{ +} + +ThemeManager::~ThemeManager() +{ +} + +void ThemeManager::setTheme(Q3DTheme *theme) +{ + if (!theme) + return; + + if (m_theme.data() != theme) { + // Disconnect old theme signal connections + if (m_theme) { + disconnect(m_theme.data(), 0, m_controller, 0); + disconnect(m_theme.data(), 0, this, 0); + } + + m_theme.reset(theme); + + QDataVis::Theme type = m_theme->type(); + + if (type != QDataVis::ThemeUserDefined) + useTheme(type); + + // Connect signals from new one + connectThemeSignals(); + } +} + +Q3DTheme *ThemeManager::theme() const +{ + return m_theme.data(); +} + +void ThemeManager::connectThemeSignals() +{ + // TODO: Implement receiving end for the commented ones (QTRD-2538) + connect(m_theme.data(), &Q3DTheme::baseColorChanged, + m_controller, &Abstract3DController::setObjectColor); +// connect(m_theme.data(), &Q3DTheme::backgroundColorChanged, +// m_controller, &Abstract3DController::setBackgroundColorColor); +// connect(m_theme.data(), &Q3DTheme::windowColorChanged, +// m_controller, &Abstract3DController::setWindowColor); +// connect(m_theme.data(), &Q3DTheme::textColorChanged, +// m_controller, &Abstract3DController::setTextColor); +// connect(m_theme.data(), &Q3DTheme::textBackgroundColorChanged, +// m_controller, &Abstract3DController::setTextBackgroundColor); +// connect(m_theme.data(), &Q3DTheme::gridLineColorChanged, +// m_controller, &Abstract3DController::setGridLineColor); + connect(m_theme.data(), &Q3DTheme::singleHighlightColorChanged, + m_controller, &Abstract3DController::setSingleHighlightColor); + connect(m_theme.data(), &Q3DTheme::multiHighlightColorChanged, + m_controller, &Abstract3DController::setMultiHighlightColor); +// connect(m_theme.data(), &Q3DTheme::lightColorChanged, +// m_controller, &Abstract3DController::setLightColor); + connect(m_theme.data(), &Q3DTheme::baseGradientChanged, + m_controller, &Abstract3DController::setObjectGradient); + connect(m_theme.data(), &Q3DTheme::singleHighlightGradientChanged, + m_controller, &Abstract3DController::setSingleHighlightGradient); + connect(m_theme.data(), &Q3DTheme::multiHighlightGradientChanged, + m_controller, &Abstract3DController::setMultiHighlightGradient); +// connect(m_theme.data(), &Q3DTheme::lightStrengthChanged, +// m_controller, &Abstract3DController::setLightStrength); +// connect(m_theme.data(), &Q3DTheme::ambientLightStrengthChanged, +// m_controller, &Abstract3DController::setAmbientLightStrength); +// connect(m_theme.data(), &Q3DTheme::highlightLightStrengthChanged, +// m_controller, &Abstract3DController::setHighlightLightStrength); +// connect(m_theme.data(), &Q3DTheme::labelBorderEnabledChanged, +// m_controller, &Abstract3DController::setLabelBorderEnabled); + connect(m_theme.data(), &Q3DTheme::colorStyleChanged, + m_controller, &Abstract3DController::setColorStyle); + + connect(m_theme.data(), &Q3DTheme::typeChanged, this, &ThemeManager::useTheme); +} + +void ThemeManager::useTheme(QDataVis::Theme type) +{ + switch (type) { + case QDataVis::ThemeQt: { + m_theme->setBaseColor(QColor(QRgb(0x80c342))); + m_theme->setBackgroundColor(QColor(QRgb(0xffffff))); + m_theme->setWindowColor(QColor(QRgb(0xffffff))); + m_theme->setTextColor(QColor(QRgb(0x35322f))); + m_theme->setTextBackgroundColor(QColor(0xff, 0xff, 0xff, 0x99)); + m_theme->setGridLineColor(QColor(QRgb(0xd7d6d5))); + m_theme->setSingleHighlightColor(QColor(QRgb(0x14aaff))); + m_theme->setMultiHighlightColor(QColor(QRgb(0x6400aa))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(true); + m_theme->setColorStyle(QDataVis::ColorStyleUniform); + break; + } + + case QDataVis::ThemePrimaryColors: { + m_theme->setBaseColor(QColor(QRgb(0xffe400))); + m_theme->setBackgroundColor(QColor(QRgb(0xffffff))); + m_theme->setWindowColor(QColor(QRgb(0xffffff))); + m_theme->setTextColor(QColor(QRgb(0x000000))); + m_theme->setTextBackgroundColor(QColor(0xff, 0xff, 0xff, 0x99)); + m_theme->setGridLineColor(QColor(QRgb(0xd7d6d5))); + m_theme->setSingleHighlightColor(QColor(QRgb(0x27beee))); + m_theme->setMultiHighlightColor(QColor(QRgb(0xee1414))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(false); + m_theme->setColorStyle(QDataVis::ColorStyleUniform); + break; + } + + case QDataVis::ThemeDigia: { + m_theme->setBackgroundColor(QColor(QRgb(0xffffff))); + m_theme->setWindowColor(QColor(QRgb(0xffffff))); + m_theme->setTextColor(QColor(QRgb(0x000000))); + m_theme->setTextBackgroundColor(QColor(0xff, 0xff, 0xff, 0x80)); + m_theme->setGridLineColor(QColor(QRgb(0xd7d6d5))); + m_theme->setSingleHighlightColor(QColor(QRgb(0xfa0000))); + m_theme->setMultiHighlightColor(QColor(QRgb(0x555555))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(false); + m_theme->setColorStyle(QDataVis::ColorStyleObjectGradient); + QLinearGradient gradient = QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0); + QColor color; + color.setRed(0xcc * 0.7); + color.setGreen(0xcc * 0.7); + color.setBlue(0xcc * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0xcccccc))); + m_theme->setBaseGradient(gradient); + color.setRed(0xfa * 0.7); + color.setGreen(0x00); + color.setBlue(0x00); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0xfa0000))); + m_theme->setSingleHighlightGradient(gradient); + color.setRed(0x55 * 0.7); + color.setGreen(0x55 * 0.7); + color.setBlue(0x55 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x555555))); + m_theme->setMultiHighlightGradient(gradient); + break; + } + + case QDataVis::ThemeStoneMoss: { + m_theme->setBaseColor(QColor(QRgb(0xbeb32b))); + m_theme->setBackgroundColor(QColor(QRgb(0x4d4d4f))); + m_theme->setWindowColor(QColor(QRgb(0x4d4d4f))); + m_theme->setTextColor(QColor(QRgb(0xffffff))); + m_theme->setTextBackgroundColor(QColor(0x4d, 0x4d, 0x4f, 0xcd)); + m_theme->setGridLineColor(QColor(QRgb(0x3e3e40))); + m_theme->setSingleHighlightColor(QColor(QRgb(0xfbf6d6))); + m_theme->setMultiHighlightColor(QColor(QRgb(0x442f20))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(true); + m_theme->setColorStyle(QDataVis::ColorStyleUniform); + break; + } + + case QDataVis::ThemeArmyBlue: { + m_theme->setBackgroundColor(QColor(QRgb(0xd5d6d7))); + m_theme->setWindowColor(QColor(QRgb(0xd5d6d7))); + m_theme->setTextColor(QColor(QRgb(0x000000))); + m_theme->setTextBackgroundColor(QColor(0xd5, 0xd6, 0xd7, 0xcd)); + m_theme->setGridLineColor(QColor(QRgb(0xaeadac))); + m_theme->setSingleHighlightColor(QColor(QRgb(0x2aa2f9))); + m_theme->setMultiHighlightColor(QColor(QRgb(0x103753))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(false); + m_theme->setColorStyle(QDataVis::ColorStyleObjectGradient); + QLinearGradient gradient = QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0); + QColor color; + color.setRed(0x49 * 0.7); + color.setGreen(0x5f * 0.7); + color.setBlue(0x76 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x495f76))); + m_theme->setBaseGradient(gradient); + color.setRed(0x2a * 0.7); + color.setGreen(0xa2 * 0.7); + color.setBlue(0xf9 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x2aa2f9))); + m_theme->setSingleHighlightGradient(gradient); + color.setRed(0x10 * 0.7); + color.setGreen(0x37 * 0.7); + color.setBlue(0x53 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x103753))); + m_theme->setMultiHighlightGradient(gradient); + break; + } + + case QDataVis::ThemeRetro: { + m_theme->setBackgroundColor(QColor(QRgb(0xe9e2ce))); + m_theme->setWindowColor(QColor(QRgb(0xe9e2ce))); + m_theme->setTextColor(QColor(QRgb(0x000000))); + m_theme->setTextBackgroundColor(QColor(0xe9, 0xe2, 0xce, 0xc0)); + m_theme->setGridLineColor(QColor(QRgb(0xd0c0b0))); + m_theme->setSingleHighlightColor(QColor(QRgb(0x8ea317))); + m_theme->setMultiHighlightColor(QColor(QRgb(0xc25708))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(false); + m_theme->setColorStyle(QDataVis::ColorStyleObjectGradient); + QLinearGradient gradient = QLinearGradient(qreal(gradientTextureWidth), + qreal(gradientTextureHeight), + 0.0, 0.0); + QColor color; + color.setRed(0x53 * 0.7); + color.setGreen(0x3b * 0.7); + color.setBlue(0x23 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x533b23))); + m_theme->setBaseGradient(gradient); + color.setRed(0x8e * 0.7); + color.setGreen(0xa3 * 0.7); + color.setBlue(0x17 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0x8ea317))); + m_theme->setSingleHighlightGradient(gradient); + color.setRed(0xc2 * 0.7); + color.setGreen(0x57 * 0.7); + color.setBlue(0x08 * 0.7); + gradient.setColorAt(0.0, color); + gradient.setColorAt(1.0, QColor(QRgb(0xc25708))); + m_theme->setMultiHighlightGradient(gradient); + break; + } + + case QDataVis::ThemeEbony: { + m_theme->setBaseColor(QColor(QRgb(0xffffff))); + m_theme->setBackgroundColor(QColor(QRgb(0x000000))); + m_theme->setWindowColor(QColor(QRgb(0x000000))); + m_theme->setTextColor(QColor(QRgb(0xaeadac))); + m_theme->setTextBackgroundColor(QColor(0x00, 0x00, 0x00, 0xcd)); + m_theme->setGridLineColor(QColor(QRgb(0x35322f))); + m_theme->setSingleHighlightColor(QColor(QRgb(0xf5dc0d))); + m_theme->setMultiHighlightColor(QColor(QRgb(0xd72222))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(false); + m_theme->setColorStyle(QDataVis::ColorStyleUniform); + break; + } + + case QDataVis::ThemeIsabelle: { + m_theme->setBaseColor(QColor(QRgb(0xf9d900))); + m_theme->setBackgroundColor(QColor(QRgb(0x000000))); + m_theme->setWindowColor(QColor(QRgb(0x000000))); + m_theme->setTextColor(QColor(QRgb(0xaeadac))); + m_theme->setTextBackgroundColor(QColor(0x00, 0x00, 0x00, 0xc0)); + m_theme->setGridLineColor(QColor(QRgb(0x35322f))); + m_theme->setSingleHighlightColor(QColor(QRgb(0xfff7cc))); + m_theme->setMultiHighlightColor(QColor(QRgb(0xde0a0a))); + m_theme->setLightStrength(5.0f); + m_theme->setAmbientLightStrength(0.5f); + m_theme->setHighlightLightStrength(5.0f); + m_theme->setLabelBorderEnabled(false); + m_theme->setColorStyle(QDataVis::ColorStyleUniform); + break; + } + } +} + +QT_DATAVISUALIZATION_END_NAMESPACE diff --git a/src/datavisualization/theme/thememanager_p.h b/src/datavisualization/theme/thememanager_p.h new file mode 100644 index 00000000..0b05dc9b --- /dev/null +++ b/src/datavisualization/theme/thememanager_p.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QtDataVisualization API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef THEMEMANAGER_P_H +#define THEMEMANAGER_P_H + +#include "datavisualizationglobal_p.h" +#include "abstract3dcontroller_p.h" +#include "q3dtheme.h" + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +class ThemeManager : public QObject +{ + Q_OBJECT +public: + ThemeManager(Abstract3DController *controller); + ~ThemeManager(); + + void setTheme(Q3DTheme *theme); + Q3DTheme *theme() const; + +protected: + void connectThemeSignals(); + void useTheme(QDataVis::Theme type); + +private: + QScopedPointer m_theme; + Abstract3DController *m_controller; +}; + +QT_DATAVISUALIZATION_END_NAMESPACE + +#endif -- cgit v1.2.3