diff --git a/examples/canvas3d/jsonmodels/doc/images/jsonmodels-example.png b/examples/canvas3d/jsonmodels/doc/images/jsonmodels-example.png index 64e77a4a1ed5f60919f54bbaebe0a661c43e459b..e2b3697f3d88dc4016bd1b7a77f923a7c54b9dd2 100644 Binary files a/examples/canvas3d/jsonmodels/doc/images/jsonmodels-example.png and b/examples/canvas3d/jsonmodels/doc/images/jsonmodels-example.png differ diff --git a/examples/canvas3d/jsonmodels/doc/src/jsonmodels.qdoc b/examples/canvas3d/jsonmodels/doc/src/jsonmodels.qdoc index 2c3532abcb286df99542b3dee3f28d435babe1c2..86deacfb9e274d3edfb926191644a793930f0b27 100644 --- a/examples/canvas3d/jsonmodels/doc/src/jsonmodels.qdoc +++ b/examples/canvas3d/jsonmodels/doc/src/jsonmodels.qdoc @@ -45,8 +45,8 @@ and more than one texture. A simple mouse input handling has also been added, to allow rotating the scene and zooming into it. - The example incorporates some Qt Quick Enterprise Controls by default, but you can switch to - Qt Quick Controls instead by defining \c{#define NO_ENTERPRISE} in \c{main.cpp}. The controls + The example optionally incorporates some Qt Quick Enterprise Controls, which you can switch on + by commenting out the \c{#define NO_ENTERPRISE} line in \c{main.cpp}. The controls are used to toggle some optional animations and draw options, as well as displaying camera rotations and distance. diff --git a/examples/canvas3d/jsonmodels/jsonmodels.qml b/examples/canvas3d/jsonmodels/jsonmodels.qml index b7cb5366693d461a56a4864eb5e13e08379ae43c..67df35f914558450d358762bf89adf1ca16ca18a 100644 --- a/examples/canvas3d/jsonmodels/jsonmodels.qml +++ b/examples/canvas3d/jsonmodels/jsonmodels.qml @@ -96,65 +96,77 @@ Window { ColumnLayout { CircularGauge { + Layout.fillHeight: true minimumValue: -180 maximumValue: 180 value: canvas3d.xRot style: CircularGaugeStyle { labelStepSize: 30 tickmarkStepSize: 15 - background: Canvas { - Text { - font.pixelSize: 20 - text: "x angle: " + angle - color: "lightgray" - horizontalAlignment: Text.AlignHCenter - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.verticalCenter - anchors.topMargin: parent.height / 8 - readonly property int angle: canvas3d.xRot - } + } + Rectangle { + anchors.fill: parent + color: "#00000000" + z: parent.z - 1 + Text { + font.pixelSize: 20 + text: "x angle: " + angle + color: "darkgray" + horizontalAlignment: Text.AlignHCenter + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.verticalCenter + anchors.topMargin: parent.height / 8 + readonly property int angle: canvas3d.xRot } } } CircularGauge { + Layout.fillHeight: true minimumValue: -90 maximumValue: 90 value: canvas3d.yRot style: CircularGaugeStyle { labelStepSize: 30 tickmarkStepSize: 15 - background: Canvas { - Text { - font.pixelSize: 20 - text: "y angle: " + angle - color: "lightgray" - horizontalAlignment: Text.AlignHCenter - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.verticalCenter - anchors.topMargin: parent.height / 8 - readonly property int angle: canvas3d.yRot - } + } + Rectangle { + anchors.fill: parent + color: "#00000000" + z: parent.z - 1 + Text { + font.pixelSize: 20 + text: "y angle: " + angle + color: "darkgray" + horizontalAlignment: Text.AlignHCenter + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.verticalCenter + anchors.topMargin: parent.height / 8 + readonly property int angle: canvas3d.yRot } } } CircularGauge { + Layout.fillHeight: true minimumValue: 0 maximumValue: 100 value: canvas3d.distance * 10 style: CircularGaugeStyle { labelStepSize: 20 tickmarkStepSize: 10 - background: Canvas { - Text { - font.pixelSize: 20 - text: "distance: " + distance - color: "lightgray" - horizontalAlignment: Text.AlignHCenter - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.verticalCenter - anchors.topMargin: parent.height / 8 - readonly property int distance: canvas3d.distance * 10 - } + } + Rectangle { + anchors.fill: parent + color: "#00000000" + z: parent.z - 1 + Text { + font.pixelSize: 20 + text: "distance: " + distance + color: "darkgray" + horizontalAlignment: Text.AlignHCenter + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.verticalCenter + anchors.topMargin: parent.height / 8 + readonly property int distance: canvas3d.distance * 10 } } } diff --git a/examples/canvas3d/jsonmodels/jsonmodelsbasic.qml b/examples/canvas3d/jsonmodels/jsonmodelsbasic.qml index db96281ac18ad96b1b84946dca9f26ee5f126f06..566d1d294c0f22e0f30587cb8ed2d60f5cfc2bd2 100644 --- a/examples/canvas3d/jsonmodels/jsonmodelsbasic.qml +++ b/examples/canvas3d/jsonmodels/jsonmodelsbasic.qml @@ -107,23 +107,27 @@ Window { Layout.fillWidth: true Button { id: lightButton + Layout.fillWidth: true text: "Animate Light" checkable: true onCheckedChanged: canvas3d.animatingLight = checked } Button { id: cameraButton + Layout.fillWidth: true text: "Animate Camera" checkable: true onCheckedChanged: canvas3d.animatingCamera = checked } Button { id: drawButton + Layout.fillWidth: true text: "Wireframe" checkable: true onCheckedChanged: canvas3d.drawWireframe = checked } Button { + Layout.fillWidth: true text: "Reset" onClicked: { canvas3d.xRot = 0.0 @@ -139,6 +143,7 @@ Window { } } Button { + Layout.fillWidth: true text: "Quit" onClicked: Qt.quit() } diff --git a/examples/canvas3d/jsonmodels/main.cpp b/examples/canvas3d/jsonmodels/main.cpp index e93862ee0946c624c4c9c1a9759509694066510a..64e98514e384ba2d045bec20a1c806e45604c5d9 100644 --- a/examples/canvas3d/jsonmodels/main.cpp +++ b/examples/canvas3d/jsonmodels/main.cpp @@ -1,4 +1,4 @@ -//#define NO_ENTERPRISE +#define NO_ENTERPRISE #include <QGuiApplication> #include <QQmlApplicationEngine>