equal
deleted
inserted
replaced
|
1 import QtQuick |
|
2 import QtQuick.Controls |
|
3 import QtQuick.Dialogs |
|
4 import QtQuick.Layouts |
|
5 |
|
6 ApplicationWindow { |
|
7 height: 900 |
|
8 title: qsTr("Tracer") |
|
9 visible: true |
|
10 width: 1200 |
|
11 |
|
12 header: ToolBar { |
|
13 RowLayout { |
|
14 Button { |
|
15 text: qsTr("Choose Image...") |
|
16 |
|
17 onClicked: fileDialog.open() |
|
18 } |
|
19 |
|
20 Button { |
|
21 text: qsTr("Start") |
|
22 |
|
23 onClicked: { |
|
24 stepTimer.start(); |
|
25 } |
|
26 } |
|
27 |
|
28 Button { |
|
29 text: qsTr("Stop") |
|
30 |
|
31 onClicked: { |
|
32 stepTimer.stop(); |
|
33 } |
|
34 } |
|
35 } |
|
36 } |
|
37 |
|
38 FileDialog { |
|
39 id: fileDialog |
|
40 |
|
41 nameFilters: ["Hedgehog images (*.png)"] |
|
42 |
|
43 onAccepted: { |
|
44 console.log("Hello") |
|
45 baseImage.source = selectedFile; |
|
46 tracer.start(fileDialog.selectedFile); |
|
47 } |
|
48 } |
|
49 |
|
50 Tracer { |
|
51 id: tracer |
|
52 } |
|
53 |
|
54 |
|
55 Timer { |
|
56 id: stepTimer |
|
57 |
|
58 interval: 1500 |
|
59 repeat: true |
|
60 running: false |
|
61 triggeredOnStart: true |
|
62 |
|
63 onTriggered: tracer.step() |
|
64 } |
|
65 |
|
66 ColumnLayout { |
|
67 anchors.fill: parent |
|
68 |
|
69 Image { |
|
70 id: baseImage |
|
71 |
|
72 Layout.fillWidth: true |
|
73 Layout.preferredHeight: 128 |
|
74 fillMode: Image.PreserveAspectFit |
|
75 } |
|
76 |
|
77 GridLayout { |
|
78 Layout.fillWidth: true |
|
79 Layout.fillHeight: true |
|
80 columns: 10 |
|
81 |
|
82 Repeater { |
|
83 model: tracer.solutions |
|
84 |
|
85 Image { |
|
86 width: 32 |
|
87 height: 32 |
|
88 source: "file://" + modelData |
|
89 fillMode: Image.PreserveAspectFit |
|
90 |
|
91 Rectangle { |
|
92 border.width: 1 |
|
93 border.color: "black" |
|
94 color: "transparent" |
|
95 anchors.fill: parent |
|
96 } |
|
97 } |
|
98 } |
|
99 } |
|
100 } |
|
101 } |