From 6c2aec18ed7f043c17b09c939b9bc521def37aa5 Mon Sep 17 00:00:00 2001 From: Tuomo Pelkonen Date: Thu, 14 Jan 2021 10:49:40 +0200 Subject: Fix most of the QML example applications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most of the QML examples work now as supposed to. Qmlbars still needs fixing and is not included in this patch. Task-number: QTBUG-89298 Change-Id: Ic8bc6511cdb00dd3db0a181b7a31b3bbc39f0556 Reviewed-by: Tomi Korpipää --- .../qml/qmlsurfacelayers/NewButton.qml | 65 ---------------------- .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 63 +++++---------------- 2 files changed, 14 insertions(+), 114 deletions(-) delete mode 100644 examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/NewButton.qml (limited to 'examples/datavisualization/qmlsurfacelayers/qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/NewButton.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/NewButton.qml deleted file mode 100644 index 4b1dd5a3..00000000 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/NewButton.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.1 -import QtQuick.Controls 1.0 -import QtQuick.Controls.Styles 1.0 - -Item { - id: newbutton - - property alias text: buttonText.text - property real fontSize: 12 - - signal clicked - - implicitWidth: buttonText.implicitWidth + 5 - implicitHeight: buttonText.implicitHeight * 2 - - Button { - id: buttonText - width: parent.width - height: parent.height - - style: ButtonStyle { - label: Component { - Text { - text: buttonText.text - font.pointSize: fontSize - clip: true - wrapMode: Text.WordWrap - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - anchors.fill: parent - } - } - } - onClicked: newbutton.clicked() - } -} diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index e5c48562..c02c399f 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -27,11 +27,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.0 -import QtQuick.Controls.Styles 1.0 -import QtDataVisualization 1.0 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import QtDataVisualization import "." Item { @@ -143,7 +142,6 @@ Item { //! [3] GroupBox { - flat: true Layout.fillWidth: true Column { spacing: 10 @@ -157,34 +155,19 @@ Item { CheckBox { id: layerOneToggle checked: true - style: CheckBoxStyle { - label: Label { - font.pointSize: fontSize - text: "Show Ground Layer" - } - } + text: "Show Ground Layer" } CheckBox { id: layerTwoToggle checked: true - style: CheckBoxStyle { - label: Label { - font.pointSize: fontSize - text: "Show Sea Layer" - } - } + text: "Show Sea Layer" } CheckBox { id: layerThreeToggle checked: true - style: CheckBoxStyle { - label: Label { - font.pointSize: fontSize - text: "Show Tectonic Layer" - } - } + text: "Show Tectonic Layer" } } } @@ -192,7 +175,6 @@ Item { //! [5] GroupBox { - flat: true Layout.fillWidth: true Column { spacing: 10 @@ -205,12 +187,7 @@ Item { CheckBox { id: layerOneGrid - style: CheckBoxStyle { - label: Label { - font.pointSize: fontSize - text: "Show Ground as Grid" - } - } + text: "Show Ground as Grid" onCheckedChanged: { if (checked) layerOneSeries.drawMode = Surface3DSeries.DrawWireframe @@ -221,12 +198,8 @@ Item { CheckBox { id: layerTwoGrid - style: CheckBoxStyle { - label: Label { - font.pointSize: fontSize - text: "Show Sea as Grid" - } - } + text: "Show Sea as Grid" + onCheckedChanged: { if (checked) layerTwoSeries.drawMode = Surface3DSeries.DrawWireframe @@ -237,12 +210,7 @@ Item { CheckBox { id: layerThreeGrid - style: CheckBoxStyle { - label: Label { - font.pointSize: fontSize - text: "Show Tectonic as Grid" - } - } + text: "Show Tectonic as Grid" onCheckedChanged: { if (checked) layerThreeSeries.drawMode = Surface3DSeries.DrawWireframe @@ -255,10 +223,9 @@ Item { //! [5] //! [6] - NewButton { + Button { id: sliceButton text: "Slice All Layers" - fontSize: fontSize Layout.fillWidth: true Layout.minimumHeight: 40 onClicked: { @@ -276,9 +243,8 @@ Item { } //! [6] - NewButton { + Button { id: shadowButton - fontSize: fontSize Layout.fillWidth: true Layout.minimumHeight: 40 text: surfaceLayers.shadowsSupported ? "Show Shadows" : "Shadows not supported" @@ -294,9 +260,8 @@ Item { } } - NewButton { + Button { id: renderModeButton - fontSize: fontSize text: "Switch Render Mode" Layout.fillWidth: true Layout.minimumHeight: 40 -- cgit v1.2.3