summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/planets-qml
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/planets-qml
parentd788bcd6fd1b28994f467433b1486ac759952348 (diff)
Update examples
Not all work Change-Id: I7954f9fe41160c929ff48f8bdeae635b900fef33 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/planets-qml')
-rw-r--r--examples/qt3d/planets-qml/PlanetsMain.qml30
-rw-r--r--examples/qt3d/planets-qml/SolarSystem.qml6
-rw-r--r--examples/qt3d/planets-qml/StyledSlider.qml35
-rw-r--r--examples/qt3d/planets-qml/main.cpp1
4 files changed, 20 insertions, 52 deletions
diff --git a/examples/qt3d/planets-qml/PlanetsMain.qml b/examples/qt3d/planets-qml/PlanetsMain.qml
index c9d826784..91cbfd4bd 100644
--- a/examples/qt3d/planets-qml/PlanetsMain.qml
+++ b/examples/qt3d/planets-qml/PlanetsMain.qml
@@ -82,18 +82,18 @@ Item {
break
case "setRotationSpeed":
rotationSpeedSlider.forceActiveFocus()
- rotationSpeedSlider.value = rotationSpeedSlider.minimumValue +
- ((rotationSpeedSlider.maximumValue - rotationSpeedSlider.minimumValue) * value)
+ rotationSpeedSlider.value = rotationSpeedSlider.from +
+ ((rotationSpeedSlider.to - rotationSpeedSlider.from) * value)
break
case "setViewingDistance":
viewingDistanceSlider.forceActiveFocus()
- viewingDistanceSlider.value = viewingDistanceSlider.minimumValue +
- ((viewingDistanceSlider.maximumValue - viewingDistanceSlider.minimumValue) * value)
+ viewingDistanceSlider.value = viewingDistanceSlider.from +
+ ((viewingDistanceSlider.to - viewingDistanceSlider.from) * value)
break
case "setPlanetSize":
planetSizeSlider.forceActiveFocus()
- planetSizeSlider.value = planetSizeSlider.minimumValue +
- ((planetSizeSlider.maximumValue - planetSizeSlider.minimumValue) * value)
+ planetSizeSlider.value = planetSizeSlider.from +
+ ((planetSizeSlider.to - planetSizeSlider.from) * value)
break
}
}
@@ -349,8 +349,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
width: sliderLength
value: 0.2
- minimumValue: 0
- maximumValue: 1
+ from: 0
+ to: 1
onValueChanged: solarsystem.changeSpeed(value)
focus: Qt.platform.os === "tvos" ? true : false
@@ -376,7 +376,7 @@ Item {
}
onPannedHorizontally: {
- var step = (maximumValue - minimumValue) / 30
+ var step = (to - from) / 30
if (p > 0) {
value += step
@@ -415,8 +415,8 @@ Item {
orientation: Qt.Vertical
height: sliderLength
value: 1
- minimumValue: 1
- maximumValue: 2
+ from: 1
+ to: 2
//! [2]
onValueChanged: solarsystem.changeCameraDistance(value)
//! [2]
@@ -442,7 +442,7 @@ Item {
}
onPannedVertically: {
- var step = (maximumValue - minimumValue) / 30
+ var step = (to - from) / 30
if (p > 0) {
value += step
@@ -498,8 +498,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
width: sliderLength
value: 1200
- minimumValue: 1
- maximumValue: 2000
+ from: 1
+ to: 2000
onValueChanged: solarsystem.changeScale(value, false)
property bool panningEnabled: false
@@ -523,7 +523,7 @@ Item {
}
onPannedHorizontally: {
- var step = (maximumValue - minimumValue) / 30
+ var step = (to - from) / 30
if (p > 0) {
value += step
diff --git a/examples/qt3d/planets-qml/SolarSystem.qml b/examples/qt3d/planets-qml/SolarSystem.qml
index 2b56237f5..e5d8c957e 100644
--- a/examples/qt3d/planets-qml/SolarSystem.qml
+++ b/examples/qt3d/planets-qml/SolarSystem.qml
@@ -227,7 +227,7 @@ Entity {
target: sceneRoot
properties: "xLookAtOffset, yLookAtOffset, zLookAtOffset"
to: 0
- easing.type: Easing.InOutQuint
+// easing.type: Easing.InOutQuint
duration: 1250
}
@@ -236,14 +236,14 @@ Entity {
target: sceneRoot
properties: "xCameraOffset, yCameraOffset, zCameraOffset"
to: 0
- easing.type: Easing.InOutQuint
+// easing.type: Easing.InOutQuint
duration: 2500
}
//! [0]
QQ2.Behavior on cameraNear {
QQ2.PropertyAnimation {
- easing.type: Easing.InOutQuint
+// easing.type: Easing.InOutQuint
duration: 2500
}
}
diff --git a/examples/qt3d/planets-qml/StyledSlider.qml b/examples/qt3d/planets-qml/StyledSlider.qml
index 6694d136e..69b0cc218 100644
--- a/examples/qt3d/planets-qml/StyledSlider.qml
+++ b/examples/qt3d/planets-qml/StyledSlider.qml
@@ -49,42 +49,9 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.3
+import QtQuick.Controls 2.0
Slider {
id: styledSlider
-
- style: SliderStyle {
- groove: Rectangle {
- implicitWidth: 200
- implicitHeight: 5
- color: "#5d5b59"
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- width: styleData.handlePosition
- height: 5
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#80c342" }
- GradientStop { position: 1.0; color: "#328930" }
- }
- }
- }
- handle: Rectangle {
- Rectangle {
- anchors.centerIn: parent
- color: "#aeadac"
- border.color: "#1e1b18"
- border.width: 1
- implicitWidth: 8
- implicitHeight: 20
- }
- anchors.centerIn: parent
- color: "transparent"
- border.width: 0
- implicitWidth: 50
- implicitHeight: 50
- }
- }
}
diff --git a/examples/qt3d/planets-qml/main.cpp b/examples/qt3d/planets-qml/main.cpp
index b044a22b2..07bfad5a2 100644
--- a/examples/qt3d/planets-qml/main.cpp
+++ b/examples/qt3d/planets-qml/main.cpp
@@ -69,6 +69,7 @@ int main(int argc, char **argv)
NetworkController networkController;
+ QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
QQuickView view;
view.setFormat(format);
view.rootContext()->setContextProperty("networkController", &networkController);