c++ - 从 url 加载图像到 StandardListItem

标签 c++ blackberry qml blackberry-10

我的 Blackberry 10 应用程序的 QML 中有以下 ListView:

ListView {
            id: listview
            objectName: "listview"
            dataModel: _app.model
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill

            //visible: false
            listItemComponents: [
                ListItemComponent {
                    type: "item"

                    // Use a standard list item to display the data in the model
                    StandardListItem {
                        title: ListItemData.title
                        imageSource: ListItemData.poster_url
                        description: ListItemData.description
                    }                   
                }
            ]
        } // ListView

我的应用程序从网络向模型添加数据。但是,似乎 QML 不支持从网络加载图像,因为我收到以下错误:

"Unsupported scheme (http) used in url (http://image.url.org/xxxxx.jpg). Image loading aborted." 

我该如何处理?

提前谢谢你。

最佳答案

imageview 默认不支持从 url 加载图片。您可以实现支持从 Internet 加载图像的 webimageview,并在您的 ListView 中使用它。 github 上提供了 webimageview 示例项目

关于c++ - 从 url 加载图像到 StandardListItem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34266658/

相关文章:

c# - 将 C++ 结构编码到 C#

c++ - 如何在 C++ 中为指针 'this' 赋值

html - 在黑莓上垂直对齐 html 输入文本

blackberry - 如何在 Blackberry MapField 中显示多个位置?

c++ - 使用 C++ 更改 qml 文件中的 ListModel 数据

c++ - 如何递归到 "print list from tail to head"?

c++ - 如何在 GLSL 中使用 4x4 矩阵作为顶点属性?

黑莓:自动打开缩小键盘

python - 代码中的 QML ListView 部分

Qt - 从不同的 qml 文件中的组件更改属性