Debian Codegraph @

tests/manual/compute-manual/main.qml

raw
1 // Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 import QtQuick 2.14
5 import QtQuick.Scene3D 2.14
6 import QtQuick.Controls 2.14
7 import QtQuick.Layouts 1.1
8 import Qt3D.Render 2.14
9
10 Item {
11
12 Scene3D {
13 anchors.fill: parent
14 aspects: ["input", "logic"]
15 focus: true
16 ParticlesScene {
17 id: scene
18 computeMode: runModeCombo.currentIndex === 0 ? ComputeCommand.Continuous : ComputeCommand.Manual
19 }
20 }
21
22 RowLayout {
23 id: colorLayout
24 anchors.left: parent.left
25 anchors.leftMargin: 35
26 anchors.bottom: parent.bottom
27 anchors.bottomMargin: 35
28 spacing: 15
29
30 RowLayout {
31 Text {
32 text: "Run Mode:"
33 color: "white"
34 }
35 ComboBox {
36 id: runModeCombo
37 model: ["Continuous", "Manual"]
38 }
39 }
40 RowLayout {
41 visible: runModeCombo.currentIndex === 1
42 Text {
43 color: "white"
44 text: "Frames"
45 }
46 SpinBox {
47 id: frameCountSpinBox
48 value: 5
49 from: 1
50 to: 10
51 stepSize: 1
52 }
53 Button {
54 text: "Trigger"
55 onClicked: {
56 // Trigger Compute Manual
57 scene.triggerCompute(frameCountSpinBox.value)
58 }
59 }
60 }
61 }
62 }