summaryrefslogtreecommitdiffstats
path: root/examples/qmlscatter/qml/qmlscatter/main.qml
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-11-22 07:56:04 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-11-22 08:30:09 +0200
commit3ce4ae10e54e9c5d73826f4d6f8c5e442ac2d525 (patch)
tree6ae0bb7c1ff8720f6340453b39d481ffcf526127 /examples/qmlscatter/qml/qmlscatter/main.qml
parentd12f993ca802ff02091d6a5141d2847641bc65a8 (diff)
User-modifiable themes, part 1
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ää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/qmlscatter/qml/qmlscatter/main.qml')
-rw-r--r--examples/qmlscatter/qml/qmlscatter/main.qml10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/qmlscatter/qml/qmlscatter/main.qml b/examples/qmlscatter/qml/qmlscatter/main.qml
index 6cae72f8..8ca73628 100644
--- a/examples/qmlscatter/qml/qmlscatter/main.qml
+++ b/examples/qmlscatter/qml/qmlscatter/main.qml
@@ -53,7 +53,7 @@ Item {
//! [3]
font.family: "Lucida Handwriting"
font.pointSize: 40
- theme: AbstractGraph3D.ThemeIsabelle
+ theme: Theme3D { type: AbstractGraph3D.ThemeIsabelle }
shadowQuality: AbstractGraph3D.ShadowQualitySoftLow
//! [3]
//! [6]
@@ -135,10 +135,12 @@ Item {
text: "Change Theme"
anchors.left: cameraToggle.right
onClicked: {
- if (scatterGraph.theme === AbstractGraph3D.ThemeArmyBlue) {
- scatterGraph.theme = AbstractGraph3D.ThemeIsabelle;
+ if (scatterGraph.theme.type === AbstractGraph3D.ThemeArmyBlue) {
+ // Ownership of the theme is transferred and old theme is destroyed when setting
+ // a new one, so we need to create them dynamically
+ scatterGraph.theme = Qt.createQmlObject('import QtDataVisualization 1.0; Theme3D {type: AbstractGraph3D.ThemeIsabelle}', parent);
} else {
- scatterGraph.theme = AbstractGraph3D.ThemeArmyBlue;
+ scatterGraph.theme = Qt.createQmlObject('import QtDataVisualization 1.0; Theme3D {type: AbstractGraph3D.ThemeArmyBlue}', parent);
}
}
}