diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-07 01:32:17 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-07 01:32:17 (GMT) |
commit | 990e4215926c5fd2327e379f6ef872b8274a7f67 (patch) | |
tree | 38c2520f7d16c1b6e201260a9968ff30ad362795 /demos | |
parent | 2dd06e645cb6e1ffca1274864a62418a2ebe6504 (diff) | |
download | Qt-990e4215926c5fd2327e379f6ef872b8274a7f67.zip Qt-990e4215926c5fd2327e379f6ef872b8274a7f67.tar.gz Qt-990e4215926c5fd2327e379f6ef872b8274a7f67.tar.bz2 |
Fix QmlXmlListModel on property changes, on empty results.
Tags in flickr demo.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/declarative/flickr/content/ImageDetails.qml | 5 | ||||
-rw-r--r-- | demos/declarative/flickr/flickr.qml | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/demos/declarative/flickr/content/ImageDetails.qml b/demos/declarative/flickr/content/ImageDetails.qml index 7b16831..d721983 100644 --- a/demos/declarative/flickr/content/ImageDetails.qml +++ b/demos/declarative/flickr/content/ImageDetails.qml @@ -6,6 +6,7 @@ Flipable { property var fullScreenArea: BigImage property string photoTitle: "" property string photoDescription: "" + property string photoTags: "" property int photoWidth property int photoHeight property string photoType @@ -58,6 +59,10 @@ Flipable { text: "<b>Author:</b> " + Container.photoAuthor } Text { id: Date; color: "white"; width: 300; x: 220; anchors.top: Author.bottom text: "<b>Published:</b> " + Container.photoDate } + Text { id: TagsLabel; color: "white"; x: 220; anchors.top: Date.bottom; + text: Container.photoTags == "" ? "" : "<b>Tags:</b> " } + Text { id: Tags; color: "white"; width: parent.width-x-20; anchors.left: TagsLabel.right; anchors.top: Date.bottom; elide: "ElideRight" + text: Container.photoTags == "" ? "" : Container.photoTags } ScrollBar { id: ScrollBar; x: 720; y: Flickable.y; width: 7; height: Flickable.height; opacity: 0; flickableArea: Flickable; clip: true } diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 0ff539d..676e51b 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -8,7 +8,8 @@ Item { resources: [ XmlListModel { id: FeedModel - source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2" + property string tags : "" + source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "")+"format=rss2" query: "doc($src)/rss/channel/item" namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" @@ -16,6 +17,7 @@ Item { Role { name: "imagePath"; query: "media:thumbnail/@url/string()" } Role { name: "url"; query: "media:content/@url/string()" } Role { name: "description"; query: "description/string()"; isCData: true } + Role { name: "tags"; query: "media:category/string()" } Role { name: "photoWidth"; query: "media:content/@width/string()" } Role { name: "photoHeight"; query: "media:content/@height/string()" } Role { name: "photoType"; query: "media:content/@type/string()" } @@ -44,6 +46,7 @@ Item { ImageDetails.flickableArea.yPosition = 0; ImageDetails.fullScreenArea.source = ""; ImageDetails.photoDescription = description; + ImageDetails.photoTags = tags; ImageDetails.photoWidth = photoWidth; ImageDetails.photoHeight = photoHeight; ImageDetails.photoType = photoType; @@ -134,7 +137,7 @@ Item { } PathAttribute { name: "scale"; value: 1 } - PathAttribute { name: "angle"; value: 45 } + PathAttribute { name: "angle"; value: -45 } } } @@ -151,7 +154,7 @@ Item { text: "Update" anchors.right: CloseButton.left; anchors.rightMargin: 5 anchors.top: CloseButton.top - onClicked: { FeedModel.fetch(); } + onClicked: { FeedModel.reload(); } } states: [ @@ -172,7 +175,9 @@ Item { } Text { - id: CategoryText; anchors.horizontalCenter: parent.horizontalCenter; y: 15; text: "Flickr - Uploads from everyone" + id: CategoryText; anchors.horizontalCenter: parent.horizontalCenter; y: 15; + text: "Flickr - " + + (FeedModel.tags=="" ? "Uploads from everyone" : "Recent Uploads tagged " + FeedModel.tags) font.size: 16; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" } } |