summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-23 09:03:00 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-23 09:25:49 +0200
commitdb4fa86cffefbc34b8da7961103ac97424ff41e9 (patch)
treef83ce363dcf06b3020a215484a7b6e779944b8e5 /src
parent0237941e81d9f6713170c67a8dec6113fec1ef01 (diff)
Add example for showing graph legend
+Fix default theme Task-number: QTRD-2653 Change-Id: Iccf4161cd19a9dfe6226189568efeb4565ba53ed Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/datavisualization/engine/abstract3dcontroller.cpp5
-rw-r--r--src/datavisualization/theme/q3dtheme.h2
-rw-r--r--src/datavisualizationqml2/abstractdeclarative.cpp8
3 files changed, 14 insertions, 1 deletions
diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp
index b7440c84..3426a715 100644
--- a/src/datavisualization/engine/abstract3dcontroller.cpp
+++ b/src/datavisualization/engine/abstract3dcontroller.cpp
@@ -29,6 +29,7 @@
#include "qtouch3dinputhandler.h"
#include "qabstract3dseries_p.h"
#include "thememanager_p.h"
+#include "q3dtheme_p.h"
#include "q3dscene_p.h"
#include "q3dscene.h"
@@ -57,7 +58,9 @@ Abstract3DController::Abstract3DController(QRect initialViewport, Q3DScene *scen
m_scene = new Q3DScene;
// Set initial theme
- setActiveTheme(new Q3DTheme(Q3DTheme::ThemeQt));
+ Q3DTheme *defaultTheme = new Q3DTheme(Q3DTheme::ThemeQt);
+ defaultTheme->d_ptr->setDefaultTheme(true);
+ setActiveTheme(defaultTheme);
m_scene->d_ptr->setViewport(initialViewport);
diff --git a/src/datavisualization/theme/q3dtheme.h b/src/datavisualization/theme/q3dtheme.h
index e023c76e..69b22124 100644
--- a/src/datavisualization/theme/q3dtheme.h
+++ b/src/datavisualization/theme/q3dtheme.h
@@ -178,6 +178,8 @@ protected:
friend class ThemeManager;
friend class Abstract3DRenderer;
friend class Bars3DController;
+ friend class AbstractDeclarative;
+ friend class Abstract3DController;
private:
Q_DISABLE_COPY(Q3DTheme)
diff --git a/src/datavisualizationqml2/abstractdeclarative.cpp b/src/datavisualizationqml2/abstractdeclarative.cpp
index e573b6f2..d04301cf 100644
--- a/src/datavisualizationqml2/abstractdeclarative.cpp
+++ b/src/datavisualizationqml2/abstractdeclarative.cpp
@@ -18,6 +18,7 @@
#include "abstractdeclarative_p.h"
#include "qvalue3daxis.h"
+#include "declarativetheme_p.h"
#include <QThread>
#include <QGuiApplication>
@@ -99,6 +100,13 @@ void AbstractDeclarative::setSharedController(Abstract3DController *controller)
{
Q_ASSERT(controller);
m_controller = controller;
+
+ // Reset default theme, as the default C++ theme is Q3DTheme, not DeclarativeTheme3D.
+ DeclarativeTheme3D *defaultTheme = new DeclarativeTheme3D;
+ defaultTheme->d_ptr->setDefaultTheme(true);
+ defaultTheme->setType(Q3DTheme::ThemeQt);
+ m_controller->setActiveTheme(defaultTheme);
+
QObject::connect(m_controller, &Abstract3DController::shadowQualityChanged, this,
&AbstractDeclarative::handleShadowQualityChange);
QObject::connect(m_controller, &Abstract3DController::activeInputHandlerChanged, this,