summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/controls
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-06-19 20:25:20 +0100
committerMike Krus <mike.krus@kdab.com>2020-06-25 07:19:28 +0100
commitd285e73c634df20f680b2661be6b20ba32e9335a (patch)
treefff62abe5cacd16a9f2c1abf56b5ea57e7c75c05 /examples/qt3d/controls
parentd788bcd6fd1b28994f467433b1486ac759952348 (diff)
Update examples
Not all work Change-Id: I7954f9fe41160c929ff48f8bdeae635b900fef33 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/controls')
-rw-r--r--examples/qt3d/controls/CMakeLists.txt1
-rw-r--r--examples/qt3d/controls/main.cpp1
-rw-r--r--examples/qt3d/controls/main.qml34
3 files changed, 19 insertions, 17 deletions
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)
}