diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2020-06-10 09:27:16 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-06-11 22:51:03 +0000 |
commit | a2f2bf69d2c8e212e7cd68f155f9d7251681a3f5 (patch) | |
tree | c0a2aba67317db7b9786c4389fde3ea0e8fcc561 /examples | |
parent | 9541760e42c4f879133e7b169957d309d98d3e59 (diff) |
Update Scene2D example to use QtQuick.Controls 2
Change-Id: I4ab815079a5fd794714bc5a7cad05e970afcd731
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Jean-Michaƫl Celerier <jean-michael.celerier@kdab.com>
(cherry picked from commit 3f98bd6a1929c32ab70531af6d82b83481d36a14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/qt3d/scene2d/LogoControls.qml | 40 | ||||
-rw-r--r-- | examples/qt3d/scene2d/main.cpp | 1 | ||||
-rw-r--r-- | examples/qt3d/scene2d/main.qml | 16 |
3 files changed, 28 insertions, 29 deletions
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 |