From d285e73c634df20f680b2661be6b20ba32e9335a Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Fri, 19 Jun 2020 20:25:20 +0100 Subject: Update examples Not all work Change-Id: I7954f9fe41160c929ff48f8bdeae635b900fef33 Reviewed-by: Paul Lemire --- examples/qt3d/controls/CMakeLists.txt | 1 + examples/qt3d/controls/main.cpp | 1 + examples/qt3d/controls/main.qml | 34 +++++++++++++++++----------------- 3 files changed, 19 insertions(+), 17 deletions(-) (limited to 'examples/qt3d/controls') diff --git a/examples/qt3d/controls/CMakeLists.txt b/examples/qt3d/controls/CMakeLists.txt index 0bdef4187..1ed8d038d 100644 --- a/examples/qt3d/controls/CMakeLists.txt +++ b/examples/qt3d/controls/CMakeLists.txt @@ -40,6 +40,7 @@ qt6_add_resources(controls "controls" FILES ${controls_resource_files} ) +target_sources(controls PRIVATE ${controls_resources_files}) # just to show qml files in creator install(TARGETS controls RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/qt3d/controls/main.cpp b/examples/qt3d/controls/main.cpp index b5e448538..e1a009bd2 100644 --- a/examples/qt3d/controls/main.cpp +++ b/examples/qt3d/controls/main.cpp @@ -55,6 +55,7 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); + QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); QQuickView view; view.resize(520, 500); diff --git a/examples/qt3d/controls/main.qml b/examples/qt3d/controls/main.qml index 5d1f9c02c..a734a1385 100644 --- a/examples/qt3d/controls/main.qml +++ b/examples/qt3d/controls/main.qml @@ -50,7 +50,7 @@ import QtQuick 2.0 import QtQuick.Scene3D 2.0 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.0 import QtQuick.Layouts 1.2 Item { @@ -86,8 +86,8 @@ Item { Slider { id: color_r Layout.fillWidth: true - minimumValue: 0 - maximumValue: 255 + from: 0 + to: 255 value: 128 } } @@ -96,8 +96,8 @@ Item { Slider { id: color_g Layout.fillWidth: true - minimumValue: 0 - maximumValue: 255 + from: 0 + to: 255 value: 195 } } @@ -106,8 +106,8 @@ Item { Slider { id: color_b Layout.fillWidth: true - minimumValue: 0 - maximumValue: 255 + from: 0 + to: 255 value: 66 } } @@ -115,8 +115,8 @@ Item { Slider { id: shining Layout.fillWidth: true - minimumValue: 30 - maximumValue: 90 + from: 30 + to: 90 value: 50 } } @@ -137,8 +137,8 @@ Item { Slider { id: rotation_x Layout.fillWidth: true - minimumValue: -45 - maximumValue: 45 + from: -45 + to: 45 value: rotationValue } } @@ -147,8 +147,8 @@ Item { Slider { id: rotation_y Layout.fillWidth: true - minimumValue: -45 - maximumValue: 45 + from: -45 + to: 45 value: rotationValue } } @@ -157,8 +157,8 @@ Item { Slider { id: rotation_z Layout.fillWidth: true - minimumValue: -45 - maximumValue: 45 + from: -45 + to: 45 value: rotationValue } } @@ -182,8 +182,8 @@ Item { Slider { id: viewCenter_z Layout.fillWidth: true - minimumValue: 4 - maximumValue: 12 + from: 4 + to: 12 value: 7.5 onValueChanged: watch.setPositionZ(value) } -- cgit v1.2.3