From 751f755213aedcfe7c36aeebf1e2ae6a010d0bde Mon Sep 17 00:00:00 2001 From: Tuomo Pelkonen Date: Mon, 15 Feb 2021 12:07:48 +0200 Subject: Fix layout and signal handling in QML apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-90664 Change-Id: I181a3b3b2a1801665a0d876a837054aa10425c0d Reviewed-by: Tomi Korpipää (cherry picked from commit 9cb0e5714182df7f7d6b4fb291ffb83b614750d5) Reviewed-by: Qt Cherry-pick Bot --- tests/manual/qmlvolume/qml/qmlvolume/main.qml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'tests') diff --git a/tests/manual/qmlvolume/qml/qmlvolume/main.qml b/tests/manual/qmlvolume/qml/qmlvolume/main.qml index ccbac009..0ce82a12 100644 --- a/tests/manual/qmlvolume/qml/qmlvolume/main.qml +++ b/tests/manual/qmlvolume/qml/qmlvolume/main.qml @@ -50,15 +50,7 @@ Item { width: dataView.width height: dataView.height orthoProjection: true - //measureFps: true - - onCurrentFpsChanged: { - if (fps > 10) - fpsText.text = "FPS: " + Math.round(surfaceGraph.currentFps) - else - fpsText.text = "FPS: " + Math.round(surfaceGraph.currentFps * 10.0) / 10.0 - } - + measureFps : false Surface3DSeries { id: surfaceSeries drawMode: Surface3DSeries.DrawSurface; @@ -92,12 +84,9 @@ Item { anchors.fill: parent RowLayout { id: sliderLayout - anchors.top: parent.top - Layout.fillHeight: true - Layout.fillWidth: true - Layout.minimumHeight: 150 + Layout.fillHeight: false spacing: 0 - + visible: surfaceGraph.measureFps Rectangle { Layout.fillHeight: true Layout.fillWidth: true @@ -116,16 +105,18 @@ Item { anchors.fill: parent verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter + text: { + return "FPS: " + surfaceGraph.currentFps > 10 + ? Math.round(surfaceGraph.currentFps) + : Math.round(surfaceGraph.currentFps * 10.0) / 10.0 + } } } } RowLayout { id: buttonLayout - Layout.fillHeight: true - Layout.fillWidth: true Layout.minimumHeight: 50 - anchors.bottom: parent.bottom spacing: 0 Button { -- cgit v1.2.3