From 08114577e37380314128ed0b05e9a2a067557824 Mon Sep 17 00:00:00 2001 From: Sami Varanka Date: Tue, 18 May 2021 16:04:25 +0300 Subject: Fix warnings in datavisualization examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ää (cherry picked from commit 3184afc8c9cea87fdfc71ed003f29cb29c23ed40) Reviewed-by: Qt Cherry-pick Bot --- .../qml3doscilloscope/qml/qml3doscilloscope/main.qml | 4 ++-- .../datavisualization/qmlaxisdrag/qml/qmlaxisdrag/main.qml | 4 ++-- examples/datavisualization/qmlbars/qml/qmlbars/main.qml | 4 ++-- .../qmlcustominput/qml/qmlcustominput/main.qml | 4 ++-- .../qmlspectrogram/qml/qmlspectrogram/main.qml | 10 ++++------ 5 files changed, 12 insertions(+), 14 deletions(-) (limited to 'examples') 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; } } } -- cgit v1.2.3