QML 3D Demo
2010-11-01 10:01
337 查看
import Qt 4.7
import org.webkit 1.0
Rectangle{
id: page
width: 960; height: 720
color: "#201F25"
Rectangle{
id: banner
width: parent.width-20
height: logo.height+20
anchors.horizontalCenter: parent.horizontalCenter
y: 10; radius: 10; z: 10
opacity: 0.9
gradient: Gradient{
GradientStop{position: 0; color: "#8B0504"}
GradientStop{position: 1; color: "black"}
}
Image{
id: logo
source:"http://hi.csdn.net/attachment/201007/27/4920523_1280246207RSd0.png"
anchors.verticalCenter: parent.verticalCenter;
x: 15
}
Text{
text: "Meego Flickr ͼƬ"
color: "white"
font.bold: true
font.pixelSize: 48
style: "Raised"
styleColor: "black"
anchors.left: logo.right
anchors.leftMargin: 50
anchors.verticalCenter: parent.verticalCenter
}
}
Rectangle{
width: parent.width-20
anchors.horizontalCenter: parent.horizontalCenter
height: page.height-banner.height-30
y: banner.height+20
color: "#201F25"
XmlListModel{
id: feedModel
source:
"http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ?
"tags="+commasep(tags)+"&" : "")+"format=rss2"
query: "/rss/channel/item"
namespaceDeclarations: "declare namespace media=/"http://search.yahoo.com/mrss//";"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" }
XmlRole { name: "description"; query: "description/string()" }
XmlRole { name: "photoAuthor"; query: "author/string()" }
}
GridView{
id: feedList
width: parent.width
height: parent.height+200
model: feedModel;
z: 0;
property bool selected: false
cellWidth: 300+10;
cellHeight: 169+10;
delegate:[
Image{
id: feedImage
source: imagePath
width: 300
height: 169
Rectangle{
id: imageTextBack;
anchors.fill: parent;
color: "black"
opacity: 0.8
visible: false
Text{
id: imageText
text: title
color: "white"
wrapMode: Text.WrapAnywhere
font.pixelSize: 24
font.bold: true;
anchors.fill: parent
horizontalAlignment: "AlignHCenter"
verticalAlignment: "AlignVCenter"
}
}
MouseArea{
id: imageRegion
anchors.fill: parent
onClicked:{
feedList.selected=true;
storyContent.html="<html><mce:style><!--
body{color: black} img{display: none} a{color: red }
--></mce:style><style mce_bogus="1">body{color:
black} img{display: none} a{color: red }</style>
<body><h1>"+title+"</h1><h3>By:"+photoAuthor+"</h3><p>"+description+"</p></body></html>"
}
}
states: [
State{
name: "hover"
when: imageRegion.containsMouse==true
PropertyChanges{target: imageTextBack; visible: true;}
}
]
}
]
transform: [
Rotation{
id: imageWall;
axis{x: 0; y: 1; z: 0}
angle: 0
}
]
}
Rectangle{
id: imageInfo
height: parent.height
width: parent.width-310
radius: 10; color: "white";
visible: false;
x: 1000
gradient: Gradient{
GradientStop{position: 0; color: "black"}
GradientStop{position: 1; color: "#1F1F1F"}
}
WebView{
a68a
id: storyContent
anchors.fill: parent;
smooth: true
html: ""
}
Rectangle{
id: buttonLogin
height: 30
width: 100
radius: 10
anchors.bottom: parent.bottom
anchors.bottomMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
color: "#011C00"
gradient: Gradient{
GradientStop{position: 0; color: "#69FF65"}
GradientStop{position: 0.4; color: "#095606"}
GradientStop{position: 0.8; color: "#69FF65"}
GradientStop{position: 1; color: "#095606"}
}
MouseArea{
anchors.fill: parent
onClicked: {feedList.selected=false}
}
Text{
anchors.centerIn: parent
text: "Back"
font.bold: true
font.pixelSize: 12
color: "white"
style: "Raised"
styleColor:"black"
}
}
}
states: [
State{
name: "selected"
when: feedList.selected==true
PropertyChanges{target: imageWall; angle: 55}
PropertyChanges{target: feedList; width: 1200}
PropertyChanges{
target: imageInfo
visible: true;
x: page.width-width-15;
}
}
]
transitions:[
Transition{
reversible: true
NumberAnimation{
properties: "angle,x"
duration: 300
}
}
]
}
}
import org.webkit 1.0
Rectangle{
id: page
width: 960; height: 720
color: "#201F25"
Rectangle{
id: banner
width: parent.width-20
height: logo.height+20
anchors.horizontalCenter: parent.horizontalCenter
y: 10; radius: 10; z: 10
opacity: 0.9
gradient: Gradient{
GradientStop{position: 0; color: "#8B0504"}
GradientStop{position: 1; color: "black"}
}
Image{
id: logo
source:"http://hi.csdn.net/attachment/201007/27/4920523_1280246207RSd0.png"
anchors.verticalCenter: parent.verticalCenter;
x: 15
}
Text{
text: "Meego Flickr ͼƬ"
color: "white"
font.bold: true
font.pixelSize: 48
style: "Raised"
styleColor: "black"
anchors.left: logo.right
anchors.leftMargin: 50
anchors.verticalCenter: parent.verticalCenter
}
}
Rectangle{
width: parent.width-20
anchors.horizontalCenter: parent.horizontalCenter
height: page.height-banner.height-30
y: banner.height+20
color: "#201F25"
XmlListModel{
id: feedModel
source:
"http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ?
"tags="+commasep(tags)+"&" : "")+"format=rss2"
query: "/rss/channel/item"
namespaceDeclarations: "declare namespace media=/"http://search.yahoo.com/mrss//";"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" }
XmlRole { name: "description"; query: "description/string()" }
XmlRole { name: "photoAuthor"; query: "author/string()" }
}
GridView{
id: feedList
width: parent.width
height: parent.height+200
model: feedModel;
z: 0;
property bool selected: false
cellWidth: 300+10;
cellHeight: 169+10;
delegate:[
Image{
id: feedImage
source: imagePath
width: 300
height: 169
Rectangle{
id: imageTextBack;
anchors.fill: parent;
color: "black"
opacity: 0.8
visible: false
Text{
id: imageText
text: title
color: "white"
wrapMode: Text.WrapAnywhere
font.pixelSize: 24
font.bold: true;
anchors.fill: parent
horizontalAlignment: "AlignHCenter"
verticalAlignment: "AlignVCenter"
}
}
MouseArea{
id: imageRegion
anchors.fill: parent
onClicked:{
feedList.selected=true;
storyContent.html="<html><mce:style><!--
body{color: black} img{display: none} a{color: red }
--></mce:style><style mce_bogus="1">body{color:
black} img{display: none} a{color: red }</style>
<body><h1>"+title+"</h1><h3>By:"+photoAuthor+"</h3><p>"+description+"</p></body></html>"
}
}
states: [
State{
name: "hover"
when: imageRegion.containsMouse==true
PropertyChanges{target: imageTextBack; visible: true;}
}
]
}
]
transform: [
Rotation{
id: imageWall;
axis{x: 0; y: 1; z: 0}
angle: 0
}
]
}
Rectangle{
id: imageInfo
height: parent.height
width: parent.width-310
radius: 10; color: "white";
visible: false;
x: 1000
gradient: Gradient{
GradientStop{position: 0; color: "black"}
GradientStop{position: 1; color: "#1F1F1F"}
}
WebView{
a68a
id: storyContent
anchors.fill: parent;
smooth: true
html: ""
}
Rectangle{
id: buttonLogin
height: 30
width: 100
radius: 10
anchors.bottom: parent.bottom
anchors.bottomMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
color: "#011C00"
gradient: Gradient{
GradientStop{position: 0; color: "#69FF65"}
GradientStop{position: 0.4; color: "#095606"}
GradientStop{position: 0.8; color: "#69FF65"}
GradientStop{position: 1; color: "#095606"}
}
MouseArea{
anchors.fill: parent
onClicked: {feedList.selected=false}
}
Text{
anchors.centerIn: parent
text: "Back"
font.bold: true
font.pixelSize: 12
color: "white"
style: "Raised"
styleColor:"black"
}
}
}
states: [
State{
name: "selected"
when: feedList.selected==true
PropertyChanges{target: imageWall; angle: 55}
PropertyChanges{target: feedList; width: 1200}
PropertyChanges{
target: imageInfo
visible: true;
x: page.width-width-15;
}
}
]
transitions:[
Transition{
reversible: true
NumberAnimation{
properties: "angle,x"
duration: 300
}
}
]
}
}
相关文章推荐
- qml demo分析(objectlistmodel-自定义qml数据)
- qml demo分析(rssnews-常见新闻布局)
- 3D翻转的动画可以参考apidemo中的 Transition3d
- Qt QML referenceexamples attached Demo hacking
- 3D动画效果照片墙demo
- 实战Unity3D开发:从认识界面到游戏demo
- QT Demo 之 window(5) window.qml
- 3D动画效果照片墙demo
- Xcode7.0 iOS 9.0 Touch 3d demo
- qml与c++混合编程之简单demo说明
- iOS 3D Touch超详细入门(附带demo示例代码)
- [导入]弯管机3D DEMO
- 源码推荐(10.09):UITableViewCell自适应大小,3D Touch 简单demo
- Unity 3D换装系统教程/Demo
- iOS 3D Touch超详细入门介绍(附带demo示例代码)
- qml demo分析(maroon-小游戏)
- jQuery插件FusionCharts绘制的3D饼状图效果实例【附demo源码下载】
- 3D动画旋转Demo
- Away 3d 入门demo
- QTDemo之calqlatr(2)calqlatr.qml