Git test
[qwp] / qwp / content / SearchModel.qml
1 import QtQuick 1.0
2
3 Item {
4     id: wrapper
5     property variant model: schModel
6     property string from : "en"
7     property string to : ""
8     property string phrase : "Qt"
9
10     property string mode : "everyone"
11     property int status: schModel.status
12     function reload() { schModel.reload(); }
13
14     XmlListModel {
15         id: schModel
16
17         source: "http://"+from+".wikipedia.org/w/api.php?action=opensearch&search="+phrase+"&limit=100&format=xml"
18         namespaceDeclarations: "declare default element namespace 'http://opensearch.org/searchsuggest2'; ";
19         query: "/SearchSuggestion/Section/Item"
20
21         XmlRole { name: "name"; query: "Text/string()" }
22         XmlRole { name: "statusText"; query: "Description/string()" }
23         XmlRole { name: "source"; query: "Url/string()" }
24         XmlRole { name: "userImage"; query: "Image/@source/string()" }
25     }
26 }