summaryrefslogtreecommitdiffstats
path: root/examples/declarative/xml
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-05-17 06:45:35 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-05-17 07:27:43 (GMT)
commit1db36a5a37dcca0e24ada3c852f2647ab2330eee (patch)
tree49bdb24dde6e2cc6bc4d5c63281498c6b757ddeb /examples/declarative/xml
parent9663e257f28a89f26952f5d3822a343bfe12ee6e (diff)
downloadQt-1db36a5a37dcca0e24ada3c852f2647ab2330eee.zip
Qt-1db36a5a37dcca0e24ada3c852f2647ab2330eee.tar.gz
Qt-1db36a5a37dcca0e24ada3c852f2647ab2330eee.tar.bz2
Move xmldata example into rssnews demo.
Diffstat (limited to 'examples/declarative/xml')
-rw-r--r--examples/declarative/xml/xmldata/daringfireball.qml47
-rw-r--r--examples/declarative/xml/xmldata/xmldata.qmlproject16
-rw-r--r--examples/declarative/xml/xmldata/yahoonews.qml83
3 files changed, 0 insertions, 146 deletions
diff --git a/examples/declarative/xml/xmldata/daringfireball.qml b/examples/declarative/xml/xmldata/daringfireball.qml
deleted file mode 100644
index 480b13c..0000000
--- a/examples/declarative/xml/xmldata/daringfireball.qml
+++ /dev/null
@@ -1,47 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- width: 600; height: 600
-
- XmlListModel {
- id: feedModel
- source: "http://daringfireball.net/index.xml"
- query: "/feed/entry"
- namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
- XmlRole { name: "title"; query: "title/string()" }
- XmlRole { name: "tagline"; query: "author/name/string()" }
- XmlRole { name: "content"; query: "content/string()" }
- }
-
- Component {
- id: feedDelegate
- Item {
- height: childrenRect.height + 20
- Text {
- id: titleText
- x: 10
- text: title; font.bold: true
- }
- Text {
- anchors { left: titleText.right; leftMargin: 10 }
- text: 'by ' + tagline
- font.italic: true
- }
- Text {
- x: 10
- width: 580
- anchors.top: titleText.bottom
- text: content
- wrapMode: Text.WordWrap
-
- onLinkActivated: { console.log('link clicked: ' + link) }
- }
- }
- }
-
- ListView {
- anchors.fill: parent
- model: feedModel
- delegate: feedDelegate
- }
-}
diff --git a/examples/declarative/xml/xmldata/xmldata.qmlproject b/examples/declarative/xml/xmldata/xmldata.qmlproject
deleted file mode 100644
index d4909f8..0000000
--- a/examples/declarative/xml/xmldata/xmldata.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- // importPaths: [ " ../exampleplugin " ]
-}
diff --git a/examples/declarative/xml/xmldata/yahoonews.qml b/examples/declarative/xml/xmldata/yahoonews.qml
deleted file mode 100644
index 5bab463..0000000
--- a/examples/declarative/xml/xmldata/yahoonews.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- width: 600; height: 600
-
- gradient: Gradient {
- GradientStop { position: 0; color: "black" }
- GradientStop { position: 1.0; color: "#AAAAAA" }
- }
-
- XmlListModel {
- id: feedModel
- source: "http://rss.news.yahoo.com/rss/oceania"
- query: "/rss/channel/item"
- XmlRole { name: "title"; query: "title/string()" }
- XmlRole { name: "link"; query: "link/string()" }
- XmlRole { name: "description"; query: "description/string()" }
- }
-
- Component {
- id: feedDelegate
-
- Item {
- id: delegate
- height: wrapper.height + 10
-
- MouseArea {
- anchors.fill: wrapper
- onPressed: delegate.ListView.view.currentIndex = index;
- onClicked: if (wrapper.state == 'Details') wrapper.state = ''; else wrapper.state = 'Details';
- }
-
- Rectangle {
- id: wrapper
-
- width: 580; y: 5; height: titleText.height + 10
- color: "#F0F0F0"
- radius: 5
-
- Text {
- id: titleText
- x: 10; y: 5
- text: '<a href=\'' + link + '\'>' + title + '</a>'
- font { bold: true; family: "Helvetica"; pointSize: 14 }
-
- onLinkActivated: { console.log('link clicked: ' + link) }
- }
-
- Text {
- id: descriptionText
- x: 10; width: 560
- anchors.top: titleText.bottom; anchors.topMargin: 5
- text: description
- wrapMode: Text.WordWrap
- font.family: "Helvetica"
- opacity: 0
- }
-
- states: State {
- name: "Details"
- PropertyChanges { target: wrapper; height: childrenRect.height + 10 }
- PropertyChanges { target: descriptionText; opacity: 1 }
- }
-
- transitions: Transition {
- from: "*"; to: "Details"; reversible: true
- SequentialAnimation {
- NumberAnimation { duration: 200; properties: "height"; easing.type: Easing.OutQuad }
- NumberAnimation { duration: 200; properties: "opacity" }
- }
- }
- }
- }
- }
-
- ListView {
- id: list
- x: 10; y: 10
- width: parent.width - 20; height: parent.height - 20
- model: feedModel
- delegate: feedDelegate
- }
-}