summaryrefslogtreecommitdiffstats
path: root/examples/qmlscatter/qml/qmlscatter/main.qml
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-12-20 10:56:59 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-07 08:10:13 +0200
commitaa842c39480aa5b95f704c97b8b3acc821144883 (patch)
tree8a1e90e1fe1d6d85054286e655cb2e1722d758eb /examples/qmlscatter/qml/qmlscatter/main.qml
parent91a94a743b4cfd30ef77aa73837050d44620469b (diff)
Fix theme ownership
Theme ownership now uses similar model as axis and inputhandler ownership: Graph can own multiple themes, but only one is active at the time. Task-number: QTRD-2623 Change-Id: I7134384df6f8cc465cc28fbebb454b7d2e254f83 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'examples/qmlscatter/qml/qmlscatter/main.qml')
-rw-r--r--examples/qmlscatter/qml/qmlscatter/main.qml30
1 files changed, 18 insertions, 12 deletions
diff --git a/examples/qmlscatter/qml/qmlscatter/main.qml b/examples/qmlscatter/qml/qmlscatter/main.qml
index e0a7f26b..50164c50 100644
--- a/examples/qmlscatter/qml/qmlscatter/main.qml
+++ b/examples/qmlscatter/qml/qmlscatter/main.qml
@@ -33,6 +33,21 @@ Item {
id: seriesData
}
//! [4]
+
+ //! [13]
+ Theme3D {
+ id: themeIsabelle
+ type: Theme3D.ThemeIsabelle
+ font.family: "Lucida Handwriting"
+ font.pointSize: 40
+ }
+ //! [13]
+
+ Theme3D {
+ id : themeArmyBlue
+ type: Theme3D.ThemeArmyBlue
+ }
+
//! [8]
//! [9]
Item {
@@ -50,11 +65,7 @@ Item {
height: dataView.height
//! [2]
//! [3]
- theme: Theme3D {
- type: Theme3D.ThemeIsabelle
- font.family: "Lucida Handwriting"
- font.pointSize: 40
- }
+ theme: themeIsabelle
shadowQuality: AbstractGraph3D.ShadowQualitySoftLow
//! [3]
//! [6]
@@ -179,14 +190,9 @@ Item {
text: "Change Theme"
onClicked: {
if (scatterGraph.theme.type === Theme3D.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: Theme3D.ThemeIsabelle; font.family: "Lucida Handwriting";
- font.pointSize: 40}', parent);
+ scatterGraph.theme = themeIsabelle
} else {
- scatterGraph.theme = Qt.createQmlObject('import QtDataVisualization 1.0;
- Theme3D {type: Theme3D.ThemeArmyBlue}', parent);
+ scatterGraph.theme = themeArmyBlue
}
}
}