-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
50 lines (41 loc) · 772 Bytes
/
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
import QtQuick 2.4
import QtQuick.Window 2.2
Window {
visible: true
opacity: 1
Loader {
id: qmlLoader
active: true
source: inputQmlFile
onLoaded: {
parent.width = qmlLoader.item.width
parent.height = qmlLoader.item.height
}
}
Timer {
id: timer
interval: 1500
repeat: false
onTriggered: {
if (qmlLoader.item) {
qmlLoader.item.grabToImage(function (result) {
result.saveToFile(outImageFile)
Qt.quit()
})
}
}
}
Component.onCompleted: {
timer.start()
}
Rectangle {
x: 10
y:20
width: 888
}
Rectangle {
x:10
y: 30
width:888
}
}