summaryrefslogtreecommitdiff
path: root/examples/demos/photoviewer/PhotoViewerCore/RssModel.qml
blob: c21cb262755b2f34059b7c250018295ec6803098 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQml.XmlListModel

XmlListModel {
    property string tags : ""

    function encodeTags(x) { return encodeURIComponent(x.replace(' ',',')); }

    source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+encodeTags(tags)+"&" : "")

    query: "/feed/entry"

    XmlListModelRole { name: "title"; elementName: "title"; attributeName: "" }
    XmlListModelRole { name: "link"; elementName: "link"; attributeName: "href" }
}