summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml')
-rw-r--r--examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml25
1 files changed, 16 insertions, 9 deletions
diff --git a/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml b/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml
index c38c3146..6eef6cc4 100644
--- a/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml
+++ b/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml
@@ -93,10 +93,7 @@ Rectangle {
yPosRole: "height"
}
//! [6]
-
- onFlatShadingSupportedChanged: {
- flatShadingToggle.text = "Flat not supported"
- }
+ onDrawModeChanged: checkState()
}
//! [4]
Surface3DSeries {
@@ -113,6 +110,8 @@ Rectangle {
minXValue: 67
maxXValue: 97
}
+
+ onDrawModeChanged: checkState()
}
//! [4]
}
@@ -135,11 +134,9 @@ Rectangle {
if (surfaceSeries.drawMode & Surface3DSeries.DrawWireframe) {
surfaceSeries.drawMode &= ~Surface3DSeries.DrawWireframe;
heightSeries.drawMode &= ~Surface3DSeries.DrawWireframe;
- text = "Show Surface Grid"
} else {
surfaceSeries.drawMode |= Surface3DSeries.DrawWireframe;
heightSeries.drawMode |= Surface3DSeries.DrawWireframe;
- text = "Hide Surface Grid"
}
}
//! [1]
@@ -155,11 +152,9 @@ Rectangle {
if (surfaceSeries.drawMode & Surface3DSeries.DrawSurface) {
surfaceSeries.drawMode &= ~Surface3DSeries.DrawSurface;
heightSeries.drawMode &= ~Surface3DSeries.DrawSurface;
- text = "Show Surface"
} else {
surfaceSeries.drawMode |= Surface3DSeries.DrawSurface;
heightSeries.drawMode |= Surface3DSeries.DrawSurface;
- text = "Hide Surface"
}
}
//! [8]
@@ -169,7 +164,7 @@ Rectangle {
id: flatShadingToggle
Layout.fillWidth: true
Layout.fillHeight: true
- text: "Show Flat"
+ text: surfaceSeries.flatShadingSupported ? "Show Flat" : "Flat not supported"
enabled: surfaceSeries.flatShadingSupported
//! [2]
onClicked: {
@@ -242,4 +237,16 @@ Rectangle {
//! [3]
}
}
+
+ function checkState() {
+ if (surfaceSeries.drawMode & Surface3DSeries.DrawSurface)
+ surfaceToggle.text = "Hide Surface"
+ else
+ surfaceToggle.text = "Show Surface"
+
+ if (surfaceSeries.drawMode & Surface3DSeries.DrawWireframe)
+ surfaceGridToggle.text = "Hide Surface Grid"
+ else
+ surfaceGridToggle.text = "Show Surface Grid"
+ }
}