diff options
author | Sami Varanka <sami.varanka@qt.io> | 2021-05-18 16:04:25 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-05-25 04:21:33 +0000 |
commit | 08114577e37380314128ed0b05e9a2a067557824 (patch) | |
tree | 629401fb7fe042adf3d38ff501851143130c1d9c | |
parent | db1a5e82fcd48e82485fe24e214f71b9e0aebfac (diff) |
Fix warnings in datavisualization examples
Injection of parameters into signal handlers
is deprecated. So those signal handlers using
parameters needed to be changed to use formal
parameters instead. Uncommented the theme in
qmlperf manual test. Added missing space to
qmlgradient manual test.
Fixes: QTBUG-92995
Change-Id: I5999df841c077be63a9f01d71188c07574b2669e
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 3184afc8c9cea87fdfc71ed003f29cb29c23ed40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
8 files changed, 25 insertions, 27 deletions
diff --git a/examples/datavisualization/qml3doscilloscope/qml/qml3doscilloscope/main.qml b/examples/datavisualization/qml3doscilloscope/qml/qml3doscilloscope/main.qml index 70484c18..ba733c21 100644 --- a/examples/datavisualization/qml3doscilloscope/qml/qml3doscilloscope/main.qml +++ b/examples/datavisualization/qml3doscilloscope/qml/qml3doscilloscope/main.qml @@ -75,7 +75,7 @@ Item { axisZ.segmentCount: 4 measureFps: true - onCurrentFpsChanged: { + onCurrentFpsChanged: (fps)=> { if (fps > 10) fpsText.text = "FPS: " + Math.round(surfaceGraph.currentFps) else @@ -118,7 +118,7 @@ Item { Rectangle { width: parent.width - height: flatShadingToggle.height * 2 + height: flatShadingToggle.implicitHeight * 2 anchors.left: parent.left anchors.top: parent.top color: surfaceGraph.theme.backgroundColor diff --git a/examples/datavisualization/qmlaxisdrag/qml/qmlaxisdrag/main.qml b/examples/datavisualization/qmlaxisdrag/qml/qmlaxisdrag/main.qml index 642da51a..ac4cbd85 100644 --- a/examples/datavisualization/qmlaxisdrag/qml/qmlaxisdrag/main.qml +++ b/examples/datavisualization/qmlaxisdrag/qml/qmlaxisdrag/main.qml @@ -186,7 +186,7 @@ Item { //! [1] //! [3] - onPositionChanged: { + onPositionChanged: (mouse)=> { currentMouseX = mouse.x; currentMouseY = mouse.y; //! [3] @@ -201,7 +201,7 @@ Item { //! [4] //! [2] - onPressed: { + onPressed: (mouse)=> { scatterGraph.scene.selectionQueryPosition = Qt.point(mouse.x, mouse.y); } //! [2] diff --git a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml index b32a2aa0..ab855fd9 100644 --- a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml +++ b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml @@ -142,7 +142,7 @@ Rectangle { ColorGradientStop { position: 0.0; color: "#600000" } } - onSelectedBarChanged: handleSelectionChange(secondarySeries, position) + onSelectedBarChanged: (position)=> handleSelectionChange(secondarySeries, position) } //! [3] @@ -171,7 +171,7 @@ Rectangle { ColorGradientStop { position: 0.0; color: "#006000" } } - onSelectedBarChanged: handleSelectionChange(barSeries, position) + onSelectedBarChanged: (position)=> handleSelectionChange(barSeries, position) } } } diff --git a/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml b/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml index 67972b6a..23fb13ee 100644 --- a/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml +++ b/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml @@ -112,14 +112,14 @@ Rectangle { //! [2] //! [3] - onPositionChanged: { + onPositionChanged: (mouse)=> { mouseX = mouse.x; mouseY = mouse.y; } //! [3] //! [5] - onWheel: { + onWheel: (wheel)=> { // Adjust zoom level based on what zoom range we're in. var zoomLevel = scatterGraph.scene.activeCamera.zoomLevel; if (zoomLevel > 100) diff --git a/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml b/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml index 3e7478ef..35143179 100644 --- a/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml +++ b/examples/datavisualization/qmlspectrogram/qml/qmlspectrogram/main.qml @@ -221,12 +221,10 @@ Window { Layout.fillHeight: true text: "Toggle axis grid on top" onClicked: { - onClicked: { - if (surfaceGraph.flipHorizontalGrid === true) { - surfaceGraph.flipHorizontalGrid = false; - } else { - surfaceGraph.flipHorizontalGrid = true; - } + if (surfaceGraph.flipHorizontalGrid === true) { + surfaceGraph.flipHorizontalGrid = false; + } else { + surfaceGraph.flipHorizontalGrid = true; } } } diff --git a/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.qml b/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.qml index d5a8506e..25bf3486 100644 --- a/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.qml +++ b/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.qml @@ -158,12 +158,12 @@ Rectangle { property int mouseX: -1 property int mouseY: -1 - onPositionChanged: { + onPositionChanged: (mouse)=> { mouseX = mouse.x; mouseY = mouse.y; } - onWheel: { + onWheel: (wheel)=> { // Adjust zoom level based on what zoom range we're in. var zoomLevel = scatterGraph.scene.activeCamera.zoomLevel; if (zoomLevel > 100) diff --git a/tests/manual/qmlgradient/qml/qmlgradient/main.qml b/tests/manual/qmlgradient/qml/qmlgradient/main.qml index 8aff340c..7df90def 100644 --- a/tests/manual/qmlgradient/qml/qmlgradient/main.qml +++ b/tests/manual/qmlgradient/qml/qmlgradient/main.qml @@ -122,7 +122,7 @@ Rectangle { axisX.title: "Latitude" axisZ.title: "Longitude" - Surface3DSeries{ + Surface3DSeries { id: heightSeries drawMode: Surface3DSeries.DrawSurface visible: true diff --git a/tests/manual/qmlperf/qml/qmlperf/main.qml b/tests/manual/qmlperf/qml/qmlperf/main.qml index 84ad4a71..1ff64ad5 100644 --- a/tests/manual/qmlperf/qml/qmlperf/main.qml +++ b/tests/manual/qmlperf/qml/qmlperf/main.qml @@ -136,17 +136,17 @@ Rectangle { fpsText.text = itemCount + " : " + scatterPlot.currentFps.toFixed(1); } -// theme: Theme3D { -// type: Theme3D.ThemeRetro -// colorStyle: Theme3D.ColorStyleRangeGradient -// baseGradients: customGradient + theme: Theme3D { + type: Theme3D.ThemeRetro + colorStyle: Theme3D.ColorStyleRangeGradient + baseGradients: customGradient -// ColorGradient { -// id: customGradient -// ColorGradientStop { position: 1.0; color: "red" } -// ColorGradientStop { position: 0.0; color: "blue" } -// } -// } + ColorGradient { + id: customGradient + ColorGradientStop { position: 1.0; color: "red" } + ColorGradientStop { position: 0.0; color: "blue" } + } + } Scatter3DSeries { id: scatterSeries |