diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-07-04 12:14:13 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-07-04 12:55:05 +0300 |
commit | 1b311517f8889e6faa8a1ae51af582c1cd07e739 (patch) | |
tree | d1b023e36b5c7ddd67368007bb64c4b8551c480b /examples/datavisualization/qmlspectrogram/qml/qmlspectrogram | |
parent | 9c3b9fb2d8f07b2b3f2e5bc84653711043c9936c (diff) |
Exposed default input handlers to QML
Also added properties to control rotation, zoom, and selection
individually.
Also added missing documentation about surface texture.
Task-number: QTRD-3202
Change-Id: I981edb7f336aea499440559f4a2098711200206d
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'examples/datavisualization/qmlspectrogram/qml/qmlspectrogram')
-rw-r--r-- | examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml b/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml index b61bf817..8bb458ca 100644 --- a/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml +++ b/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml @@ -53,7 +53,7 @@ Window { ValueAxis3D { id: xAxis segmentCount: 8 - labelFormat: "%i" + labelFormat: "%i\u00B0" title: "Angle" titleVisible: true titleFixed: false @@ -72,7 +72,7 @@ Window { ValueAxis3D { id: zAxis segmentCount: 5 - labelFormat: "%i" + labelFormat: "%i nm" title: "Radius" titleVisible: true titleFixed: false @@ -87,19 +87,32 @@ Window { backgroundEnabled: false } + + //! [5] + TouchInputHandler3D { + id: customInputHandler + rotationEnabled: false + } + //! [5] + //! [0] + //! [7] Surface3D { + //! [7] id: surfaceGraph width: surfaceView.width height: surfaceView.height shadowQuality: AbstractGraph3D.ShadowQualityNone - selectionMode: AbstractGraph3D.SelectionSlice | AbstractGraph3D.SelectionItemAndRow + selectionMode: AbstractGraph3D.SelectionSlice | AbstractGraph3D.SelectionItemAndColumn axisX: xAxis axisY: yAxis axisZ: zAxis theme: customTheme + //! [6] + inputHandler: customInputHandler + //! [6] // Remove the perspective and view the graph from top down to achieve 2D effect //! [1] @@ -124,6 +137,7 @@ Window { drawMode: Surface3DSeries.DrawSurface baseGradient: surfaceGradient colorStyle: Theme3D.ColorStyleRangeGradient + itemLabelFormat: "(@xLabel, @zLabel): @yLabel" ItemModelSurfaceDataProxy { itemModel: surfaceData.model @@ -172,6 +186,7 @@ Window { xAxis.labelAutoRotation = 30 yAxis.labelAutoRotation = 30 zAxis.labelAutoRotation = 30 + customInputHandler.rotationEnabled = true text = "Switch to orthographic" } else { surfaceGraph.orthoProjection = true; @@ -180,6 +195,7 @@ Window { xAxis.labelAutoRotation = 0 yAxis.labelAutoRotation = 0 zAxis.labelAutoRotation = 0 + customInputHandler.rotationEnabled = false text = "Switch to perspective" } } @@ -238,7 +254,7 @@ Window { anchors.margins: 20 anchors.bottom: parent.bottom anchors.top: buttonLayout.bottom - anchors.left: parent.left + anchors.right: parent.right border.color: "black" border.width: 1 width: 50 @@ -254,21 +270,21 @@ Window { Text { anchors.verticalCenter: legend.bottom - anchors.left: legend.right + anchors.right: legend.left anchors.margins: 2 text: surfaceGraph.axisY.min + "%" } Text { anchors.verticalCenter: legend.verticalCenter - anchors.left: legend.right + anchors.right: legend.left anchors.margins: 2 text: (surfaceGraph.axisY.max + surfaceGraph.axisY.min) / 2 + "%" } Text { anchors.verticalCenter: legend.top - anchors.left: legend.right + anchors.right: legend.left anchors.margins: 2 text: surfaceGraph.axisY.max + "%" } |