This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.qml
95 lines (94 loc) · 2.97 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/**
* @file
* @author Yurij Mikhalevich <[email protected]>
*
* @section LICENSE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.2
import QtQuick.Window 2.1
Window {
id: mainWindow
title: 'Squinting Arkanoid'
visible: true
width: 780
height: 480
maximumHeight: this.height
minimumHeight: this.height
maximumWidth: this.width
minimumWidth: this.width
Arkanoid {
id: arkanoid
width: parent.width / 13 * 8
height: parent.height
anchors.left: parent.left
}
Item {
id: sidebar
width: parent.width / 13 * 5
height: parent.height
anchors.right: parent.right
Item {
anchors.fill: parent
anchors.bottom: camera.top
anchors.margins: 10
Text {
id: credits
width: parent.width
height: contentHeight
text: '«Squinting Arkanoid» is an OpenCV demonstration application written\nby Yurij Mikhalevich <[email protected]>\nin C++ and JS (used in QML).\nPowered by OpenCV and Qt.'
wrapMode: Text.WordWrap
}
Item {
anchors.top: credits.bottom
width: parent.width
height: parent.height * 2 / 3
Image {
source: 'qrc:///images/opencv-logo.png'
width: parent.width / 2 - 30
fillMode: Image.PreserveAspectFit
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 20
}
Image {
source: 'qrc:///images/qt-logo.png'
width: parent.width / 2 - 10
fillMode: Image.PreserveAspectFit
anchors.right: parent.right
anchors.top: parent.top
}
}
}
Image {
id: camera
width: parent.width
height: parent.width * 0.75
cache: false
mirror: true
anchors.bottom: parent.bottom
fillMode: Image.PreserveAspectFit
}
}
Timer {
interval: 1000 / 16
repeat: true
running: true
triggeredOnStart: true
onTriggered: {
camera.source = 'image://camera/frame' + Math.random()
}
}
}