Skip to content

Commit eae5515

Browse files
qmltest works
1 parent 9dc93e9 commit eae5515

File tree

4 files changed

+45
-20
lines changed

4 files changed

+45
-20
lines changed

TestCase2-bigger.png

331 Bytes
Loading

TestCase2.png

330 Bytes
Loading

simple_screenshot.qml

+41-19
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,54 @@ Loader{
99
//Qt.quit()
1010
}
1111

12-
function testScreenshot(tag, next){
12+
// function testScreenshot(tag, next){
13+
// var path = source.toString()
14+
// .replace(".qml", "")
15+
// .replace("file://", "")
16+
// if(tag)
17+
// path = path + "-" + tag
18+
// console.log("grab" + path + ".png")
19+
// shorty.shootFull(path+ ".png")
20+
// next()
21+
// }
22+
// function testDone(){
23+
// Qt.quit()
24+
// }
25+
// function testYield()
26+
// {
27+
// }
28+
onLoaded: {
29+
console.log("load")
30+
item.start()
31+
for(var i in item.data){
32+
var child = item.data[i]
33+
if(child.toString().indexOf("Describe") === 0){
34+
child.compareRender = function(tag, callback){
35+
var path = source.toString()
36+
.replace(".qml", "")
37+
.replace("file://", "")
38+
if(tag)
39+
path = path + "-" + tag
40+
console.log("grab" + path + ".png")
41+
shorty.shootFull(path+ ".png")
42+
43+
callback(true) //doesnt compare in qt only generate
44+
}
45+
child.start()
46+
}
47+
}
48+
49+
}
50+
function compareRender2(tag, callback){
1351
var path = source.toString()
1452
.replace(".qml", "")
1553
.replace("file://", "")
1654
if(tag)
1755
path = path + "-" + tag
1856
console.log("grab" + path + ".png")
1957
shorty.shootFull(path+ ".png")
20-
next()
21-
}
22-
function testDone(){
23-
Qt.quit()
24-
}
25-
function testYield()
26-
{
27-
}
28-
onLoaded: {
29-
console.log("load")
30-
timer.start()
31-
}
3258

33-
Timer{
34-
id: timer
35-
interval: 10
36-
onTriggered: {
37-
item.test()
38-
}
59+
callback(true) //doesnt compare in qt only generate
3960
}
61+
4062
}

tests.pro

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ SOURCES = *.qml \
44
../tests/Render/Async/*.qml \
55
../tests/QtQuick/qml/*.qml \
66
../tests/QMLEngine/qml/*.qml \
7+
../tests/Tests/*.qml \
78
//}
89

910
DISTFILES += \
10-
../tests/Render/Async/tester.qml
11+
../tests/Render/Async/tester.qml \
12+
TestCase2.qml \
13+
Describe.qml
1114

0 commit comments

Comments
 (0)