Skip to content

Commit 53f3396

Browse files
grab multiple screenshots from same qml
1 parent 388d29e commit 53f3396

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

render.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ var glob = require("glob");
88
var devPath = __dirname.split("/").pop();
99

1010
var paths = [
11-
"tests/Render/Simple/*.qml"
11+
"tests/Render/Simple/*.qml",
12+
"tests/QtQuick/qml/TextBasic.qml",
13+
"tests/QtQuick/qml/RectangleColor.qml"
1214
];
1315

1416
paths.forEach(function(path) {

simple_screenshot.qml

+16-10
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@ Loader{
55
Component.onCompleted: {
66
console.log("completed")
77
console.log(script)
8-
timer.start()
9-
8+
//timer.start()
9+
//Qt.quit()
1010
}
1111

12-
function grab(){
12+
function grab(tag){
1313
var path = source.toString()
14-
.replace(".qml", ".png")
14+
.replace(".qml", "")
1515
.replace("file://", "")
16-
console.log("grab" + path)
17-
shorty.shootFull(path)
16+
if(tag)
17+
path = path + "-" + tag
18+
console.log("grab" + path + ".png")
19+
shorty.shootFull(path+ ".png")
20+
}
21+
function done(){
22+
Qt.quit()
23+
}
24+
onLoaded: {
25+
timer.start()
1826
}
27+
1928
Timer{
2029
id: timer
2130
interval: 10
2231
onTriggered: {
23-
grab()
24-
Qt.quit()
32+
item.test()
2533
}
2634
}
2735
}
28-
29-

tests.pro

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
lupdate_only {
1+
//lupdate_only {
22
SOURCES = *.qml \
33
../tests/Render/Simple/*.qml \
44
../tests/Render/Async/*.qml \
55
../tests/QtQuick/qml/*.qml \
66
../tests/QMLEngine/qml/*.qml \
7-
}
7+
//}
88

99
DISTFILES += \
1010
../tests/Render/Async/tester.qml
11+

0 commit comments

Comments
 (0)