-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQmlwebTestsViewer.qml
47 lines (37 loc) · 1004 Bytes
/
QmlwebTestsViewer.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
//import "https://github.com/pavelvasev/qmlweb.components"
import qmlweb.components
Item {
property var qmlwebTestsUrl: "qmlweb/test/testpad/"
property var files: JSON.parse(getUrlContents( Qt.resolvedUrl( qmlwebTestsUrl+"files.json") ));
Row {
x: 10
y: 10
z: 10
spacing: 5
Text {
y:3
text: "QmlWeb tests runner. Choose test:"
}
ComboBox {
model: files.map( function(e) { return e.title; } )
id: combo
}
Text {
text: "<a target='_blank' href='"+selectedSrc+"'>open test source</a>"
}
}
property var selectedSrc: {
//console.log(combo.currentIndex, files[ combo.currentIndex ]);
var s = qmlwebTestsUrl + files[ combo.currentIndex ].file;
var ss = Qt.resolvedUrl( s );
return s ? Qt.resolvedUrl( s ) : ""
}
Loader {
id: loader
source: selectedSrc
onSourceChanged: console.log("using source",source);
y: 40
width: parent.width
height: parent.height-y
}
}