From a2f2bf69d2c8e212e7cd68f155f9d7251681a3f5 Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Wed, 10 Jun 2020 09:27:16 +0200 Subject: Update Scene2D example to use QtQuick.Controls 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4ab815079a5fd794714bc5a7cad05e970afcd731 Reviewed-by: Mike Krus Reviewed-by: Jean-Michaƫl Celerier (cherry picked from commit 3f98bd6a1929c32ab70531af6d82b83481d36a14) Reviewed-by: Qt Cherry-pick Bot --- examples/qt3d/scene2d/LogoControls.qml | 40 +++++++++++++++++----------------- examples/qt3d/scene2d/main.cpp | 1 + examples/qt3d/scene2d/main.qml | 16 ++++++-------- 3 files changed, 28 insertions(+), 29 deletions(-) (limited to 'examples') diff --git a/examples/qt3d/scene2d/LogoControls.qml b/examples/qt3d/scene2d/LogoControls.qml index a71cd0e8d..84194c34a 100644 --- a/examples/qt3d/scene2d/LogoControls.qml +++ b/examples/qt3d/scene2d/LogoControls.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Scene2D 2.9 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.2 +import QtQuick 2.15 +import QtQuick.Scene2D 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 Rectangle { id: root @@ -138,8 +138,8 @@ Rectangle { Slider { id: color_r Layout.fillWidth: true - minimumValue: 0 - maximumValue: 255 + from: 0 + to: 255 value: 128 } } @@ -148,8 +148,8 @@ Rectangle { Slider { id: color_g Layout.fillWidth: true - minimumValue: 0 - maximumValue: 255 + from: 0 + to: 255 value: 195 } } @@ -158,8 +158,8 @@ Rectangle { Slider { id: color_b Layout.fillWidth: true - minimumValue: 0 - maximumValue: 255 + from: 0 + to: 255 value: 66 } } @@ -167,8 +167,8 @@ Rectangle { Slider { id: shining Layout.fillWidth: true - minimumValue: 30 - maximumValue: 90 + from: 30 + to: 90 value: 50 } } @@ -189,8 +189,8 @@ Rectangle { Slider { id: rotation_x Layout.fillWidth: true - minimumValue: -45 - maximumValue: 45 + from: -45 + to: 45 value: d.rotationValue } } @@ -199,8 +199,8 @@ Rectangle { Slider { id: rotation_y Layout.fillWidth: true - minimumValue: -45 - maximumValue: 45 + from: -45 + to: 45 value: d.rotationValue } } @@ -209,8 +209,8 @@ Rectangle { Slider { id: rotation_z Layout.fillWidth: true - minimumValue: -45 - maximumValue: 45 + from: -45 + to: 45 value: d.rotationValue } } @@ -234,8 +234,8 @@ Rectangle { Slider { id: logoCenter_z Layout.fillWidth: true - minimumValue: -10 - maximumValue: 8 + from: -10 + to: 8 value: 0 } } diff --git a/examples/qt3d/scene2d/main.cpp b/examples/qt3d/scene2d/main.cpp index 04c4ac58c..d4e2c4b1d 100644 --- a/examples/qt3d/scene2d/main.cpp +++ b/examples/qt3d/scene2d/main.cpp @@ -55,6 +55,7 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); + QQuickWindow::setSceneGraphBackend(QSGRendererInterface::OpenGLRhi); Qt3DExtras::Quick::Qt3DQuickWindow view; view.setSource(QUrl("qrc:/main.qml")); view.resize(1400, 1100); diff --git a/examples/qt3d/scene2d/main.qml b/examples/qt3d/scene2d/main.qml index ceaac3b34..37727b952 100644 --- a/examples/qt3d/scene2d/main.qml +++ b/examples/qt3d/scene2d/main.qml @@ -48,15 +48,13 @@ ** ****************************************************************************/ -import Qt3D.Core 2.9 -import Qt3D.Render 2.9 -import Qt3D.Extras 2.9 -import Qt3D.Input 2.0 - -import QtQuick 2.0 -import QtQuick.Scene2D 2.9 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.2 +import Qt3D.Core 2.15 +import Qt3D.Render 2.15 +import Qt3D.Extras 2.15 +import Qt3D.Input 2.15 + +import QtQuick 2.15 +import QtQuick.Scene2D 2.15 Entity { id: sceneRoot -- cgit v1.2.3