我想仅为一位艺术家过滤专辑,但没有显示任何内容。
我的代码是:
SelectArtistPage.qml:
import QtQuick 1.1
import com.nokia.meego 1.0
import QtMobility.gallery 1.1
Page
{
id: selectArtistPage
tools: backtoolbar
property string selectedartist
ListView
{
id: galleryView
anchors.fill: parent
clip: true
model: artistModel
delegate: Item
{
height: 60
width: parent.width
Button
{
height: 50
width: parent.width - 20
text: (artist != "") ? artist : "(unknown artist)"
onClicked:
{
selectedartist = (text != "(unknown artist)") ? text : ""
selectAlbumPageLoader.source = "SelectAlbumPage.qml"
pageStack.push(selectAlbumPageLoader.item)
}
}
}
}
DocumentGalleryModel
{
id: artistModel
rootType: DocumentGallery.Artist
properties: ["artist"]
}
}
SelectAlbumPage.qml:
import QtQuick 1.1
import com.nokia.meego 1.0
import QtMobility.gallery 1.1
Page
{
id: selectAlbumPage
tools: backtoolbar
property string selectedalbum
ListView
{
id: galleryView
anchors.fill: parent
clip: true
model: albumModel
delegate: Item
{
height: 60
width: parent.width
Button
{
height: 50
width: parent.width - 20
text: (albumTitle != "") ? albumTitle : "(unknown album)"
onClicked:
{
selectedalbum = (text != "(unknown album)") ? text : ""
// here should be launching the last page
}
}
}
}
DocumentGalleryModel
{
id: albumModel
rootType: DocumentGallery.Album
properties: ["albumTitle", "artist"]
filter: GalleryEqualsFilter
{
property: "artist"
value: selectedartist
}
}
}
当我在SelectArtistPage中选择艺术家时,会打开另一个页面,不会绘制带有专辑名称的按钮。 如果我删除过滤器,则会显示所有相册。
我做错了什么?我正在为Maemo使用Qt Mobility 1.2软件包(我在N900上测试)。
答案 0 :(得分:0)
正如我在这里写的那样,似乎是Maemo Qt Mobility中的一个错误:http://talk.maemo.org/showpost.php?p=1254495&postcount=112