diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-04-22 04:47:24 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-04-22 04:47:24 (GMT) |
commit | 2366667fc97eb6a56203b2dd7dac776ff4164abd (patch) | |
tree | b2acb6cc6bfe475d7e619e4788973b61fff775e0 /examples/declarative/xmldata/daringfireball.qml | |
parent | 2c762f3b8b284a7c6dc0c499b7052013bad5b707 (diff) | |
download | Qt-2366667fc97eb6a56203b2dd7dac776ff4164abd.zip Qt-2366667fc97eb6a56203b2dd7dac776ff4164abd.tar.gz Qt-2366667fc97eb6a56203b2dd7dac776ff4164abd.tar.bz2 |
Initial import of kinetic-dui branch from the old kinetic
Diffstat (limited to 'examples/declarative/xmldata/daringfireball.qml')
-rw-r--r-- | examples/declarative/xmldata/daringfireball.qml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/declarative/xmldata/daringfireball.qml b/examples/declarative/xmldata/daringfireball.qml new file mode 100644 index 0000000..cfd0a98 --- /dev/null +++ b/examples/declarative/xmldata/daringfireball.qml @@ -0,0 +1,25 @@ +<Rect color="white" width="600" height="600"> + <resources> + <XmlListModel id="feedModel" src="http://daringfireball.net/index.xml" + query="doc($src)/feed/entry"> + <namespaceDeclarations> + declare default element namespace 'http://www.w3.org/2005/Atom'; + </namespaceDeclarations> + <Role name="title" query="title/string()"/> + <Role name="tagline" query="author/name/string()"/> + <Role name="content" query="content/string()" isCData="true"/> + </XmlListModel> + <Component id="feedDelegate"> + <Item height="{contents.height + 20}"> + <Text x="10" id="TitleText" text="{title}" font.bold="true"/> + <Text text="{'by ' + tagline}" anchors.left="{TitleText.right}" anchors.leftMargin="10" font.italic="true"/> + <Text x="10" text="{content}" anchors.top="{TitleText.bottom}" width="580" wrap="true"> + <onLinkActivated>print('link clicked: ' + link)</onLinkActivated> + </Text> + </Item> + </Component> + </resources> + + <ListView id="list" anchors.fill="{parent}" clip="true" + model="{feedModel}" delegate="{feedDelegate}"/> +</Rect> |