diff options
Diffstat (limited to 'examples/datavisualization/qmloscilloscope/qml/qmloscilloscope')
-rw-r--r-- | examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml index 1373d4f9..c2e6b70b 100644 --- a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml +++ b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml @@ -82,6 +82,13 @@ Item { meshSmooth: true itemLabelFormat: "@xLabel, @zLabel: @yLabel" itemLabelVisible: false + + onItemLabelChanged: { + if (surfaceSeries.selectedPoint === surfaceSeries.invalidSelectionPosition) + selectionText.text = "No selection" + else + selectionText.text = surfaceSeries.itemLabel + } } //! [0] @@ -244,15 +251,7 @@ Item { anchors.fill: parent verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter - - Binding on text { - when: surfaceSeries.itemLabel.length - value: surfaceSeries.itemLabel - } - Binding on text { - when: !surfaceSeries.itemLabel.length - value: "No selection" - } + text: "No selection" } } } |