qt quick 移植的问题

fight_flight 2012-07-11 06:22:39
所有图片,xml资源文件都在.qrc中的,被一同编译到程序代码中。

在windows和ubuntu下的 n9 Qt模拟器都可以正常工作。

但把程序通过N9的Harmattan 1.2 的Qemu模拟器测试时,则出现了一个问题。
qml文件中的XmlListModel无法对qrc中的xml文件进行解析。其他用到qrc中图片的地方则没有问题。
而且在Harmattan 1.2 的Qemu模拟器上动态生成的xml,也无法通过XmlListModel解析。



在windows和ubuntu系统下则没有任何问题,这个问题要怎样解决呢???
...全文
127 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
fight_flight 2012-07-11
  • 打赏
  • 举报
回复

GuestureModel.qml

XmlListModel{
id: guestrueModel
source: ""
query: "/rss/channel/item"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "titlePhoto"; query: "titlePhoto/string()" }

XmlRole { name: "buWei"; query: "buWei/string()" }
XmlRole { name: "buWeiWord"; query: "buWeiWord/string()" }
XmlRole { name: "dongZuo"; query: "dongZuo/string()" }
}


Gue.qml的一部分

ListView{
id:guesture_view
width: 480
height: 680
model: GuestureModel{
source: "qrc:/images/info.xml"
}
delegate: Rectangle{
id: rec
border.color: "white"
border.width: 5
radius: 5
width: screen.width; height: 150
BorderImage {
source: "qrc:/images/photo_back1.png"
border.left: 5; border.top: 5
border.right: 5; border.bottom: 5
}
ToolIcon{
platformIconId: "toolbar-next"
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}

AnimatedImage{
id: guesture
source: titlePhoto
width: 140; height: 140
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
cache: false
}
Text{
text: title
//color:"#FFFFFF"
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: 20
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 35
horizontalAlignment: Text.AlignJustify
}
}

16,213

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧