summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-03-22 05:34:41 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-03-22 05:36:35 (GMT)
commit888d29c9c138ca3d698985f090ceb3db912ade0f (patch)
treeaa991f683dd8e7ea4b05d029dd75b32321fde3c0 /demos/declarative/flickr
parent42de973ff156383beed62a6b1bce70b56b360078 (diff)
downloadQt-888d29c9c138ca3d698985f090ceb3db912ade0f.zip
Qt-888d29c9c138ca3d698985f090ceb3db912ade0f.tar.gz
Qt-888d29c9c138ca3d698985f090ceb3db912ade0f.tar.bz2
Deprecate inline Script {} blocks
Inline blocks/includes have been replaced with an import syntax: import "foo.js" as Foo this gives better separation between QML and code. Imported script blocks also have a mandatory qualifier, which leads to better optimization potential.
Diffstat (limited to 'demos/declarative/flickr')
-rw-r--r--demos/declarative/flickr/flickr-desktop.qml28
-rw-r--r--demos/declarative/flickr/mobile/GridDelegate.qml24
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml14
3 files changed, 30 insertions, 36 deletions
diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml
index 99216cb..4de2202 100644
--- a/demos/declarative/flickr/flickr-desktop.qml
+++ b/demos/declarative/flickr/flickr-desktop.qml
@@ -31,21 +31,19 @@ Item {
}
}
- Script {
- function photoClicked() {
- imageDetails.photoTitle = title;
- imageDetails.photoDescription = description;
- imageDetails.photoTags = tags;
- imageDetails.photoWidth = photoWidth;
- imageDetails.photoHeight = photoHeight;
- imageDetails.photoType = photoType;
- imageDetails.photoAuthor = photoAuthor;
- imageDetails.photoDate = photoDate;
- imageDetails.photoUrl = url;
- imageDetails.rating = 0;
- wrapper.state = "Details";
- }
- }
+ function photoClicked() {
+ imageDetails.photoTitle = title;
+ imageDetails.photoDescription = description;
+ imageDetails.photoTags = tags;
+ imageDetails.photoWidth = photoWidth;
+ imageDetails.photoHeight = photoHeight;
+ imageDetails.photoType = photoType;
+ imageDetails.photoAuthor = photoAuthor;
+ imageDetails.photoDate = photoDate;
+ imageDetails.photoUrl = url;
+ imageDetails.rating = 0;
+ wrapper.state = "Details";
+ }
Rectangle {
id: whiteRect; anchors.fill: parent; color: "white"; radius: 5
diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml
index 291d874..767315c 100644
--- a/demos/declarative/flickr/mobile/GridDelegate.qml
+++ b/demos/declarative/flickr/mobile/GridDelegate.qml
@@ -5,19 +5,17 @@
Item {
id: wrapper; width: 79; height: 79
- Script {
- function photoClicked() {
- imageDetails.photoTitle = title;
- imageDetails.photoTags = tags;
- imageDetails.photoWidth = photoWidth;
- imageDetails.photoHeight = photoHeight;
- imageDetails.photoType = photoType;
- imageDetails.photoAuthor = photoAuthor;
- imageDetails.photoDate = photoDate;
- imageDetails.photoUrl = url;
- imageDetails.rating = 0;
- scaleMe.state = "Details";
- }
+ function photoClicked() {
+ imageDetails.photoTitle = title;
+ imageDetails.photoTags = tags;
+ imageDetails.photoWidth = photoWidth;
+ imageDetails.photoHeight = photoHeight;
+ imageDetails.photoType = photoType;
+ imageDetails.photoAuthor = photoAuthor;
+ imageDetails.photoDate = photoDate;
+ imageDetails.photoUrl = url;
+ imageDetails.rating = 0;
+ scaleMe.state = "Details";
}
Item {
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index 0a06771..e92ba59 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -11,12 +11,10 @@ Item {
id: container
width: (parent.width * 2) - 55 ; height: parent.height
- Script {
- function accept() {
- titleBar.state = ""
- background.state = ""
- rssModel.tags = editor.text
- }
+ function accept() {
+ titleBar.state = ""
+ background.state = ""
+ rssModel.tags = editor.text
}
Text {
@@ -32,7 +30,7 @@ Item {
Button {
id: tagButton; x: titleBar.width - 50; width: 45; height: 32; text: "..."
- onClicked: if (titleBar.state == "Tags") accept(); else titleBar.state = "Tags"
+ onClicked: if (titleBar.state == "Tags") container.accept(); else titleBar.state = "Tags"
anchors.verticalCenter: parent.verticalCenter
}
@@ -57,7 +55,7 @@ Item {
Item {
id: returnKey
- Keys.onReturnPressed: accept()
+ Keys.onReturnPressed: container.accept()
Keys.onEscapePressed: titleBar.state = ""
}
}