未找到 qml XmlListModel 插件

2023-12-30

在我的项目中,我尝试使用 qml 内置的 Xml 列表模块,但是当我编译到手机时,出现此错误

W/Qt      (20100): assets:/qml/FlickrDemo/main.qml:4 ((null)): assets:/qml/FlickrDemo/main.qml:4:1: module "QtQuick.XmlListModel" plugin "qmlxmllistmodelplugin" not found

任何帮助将非常感激。 谢谢

UPDATE

对于这两种进口产品,我在我的三星 Galaxy Note 2 和 vivo 上都得到了这个输出

E/        ( 8142): Device driver API match
E/        ( 8142): Device driver API version: 23
E/        ( 8142): User space API version: 23 
E/        ( 8142): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Fri Nov 29 14:18:37 KST 2013 
D/OpenGLRenderer( 8142): Enabling debug mode 0
W/Qt      ( 8142): assets:/qml/Demo2/main.qml:4 ((null)): assets:/qml/Demo2/main.qml:4:1: module "QtQuick.XmlListModel" plugin "qmlxmllistmodelplugin" not found 

UPDATE 2

。轮廓

# Add more folders to ship with the application, here
folder_01.source = qml/Demo2
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01

# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =

QT += qml quick network positioning

# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp

# Installation path
# target.path =

QT += xmlpatterns xml

# Please do not modify the following two lines. Required for deployment.
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
qtcAddDeployment()

main.qml

import QtQuick 2.0
import QtQuick.Controls.Styles 1.1
import QtQuick.Controls 1.1
import QtQuick.XmlListModel 2.0

Rectangle {
    id:screen
    height: 1280; width: 720

    XmlListModel{
        id:listmodel
        source:"http://api.flickr.com/services/feeds/photos_public.gne?tags=dogs"
        query:"/feed/entry"
        namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
        XmlRole{name:"img_title"; query: "title/string()"}
        XmlRole{name:"img_source";query:"link[@rel=\"alternate\"]/@href/string()"}
    }

    transitions:[
        Transition{
            NumberAnimation{
                target:layout
                property:"x"
                easing: Easing.OutSine
                duration:250
            }

        }
    ]
    states: [
        State {
            name: "view"
            PropertyChanges {
                target: layout
                x:-screen.width
            }
            PropertyChanges {
                target: btn_back
                opacity:1
            }
            PropertyChanges {
                target: te_search
                opacity:0
            }
            PropertyChanges {
                target: btn_search
                opacity:0
            }
        }
    ]

    Row{
        id:layout
        height:screen.height - te_search.height

        ListView {
            id: listview
            width:screen.width
            height:screen.height - te_search.height
            clip:true

            model: listmodel

            delegate: Item {
                width:parent.width
                height:80
                Image {
                    id:thumbnail
                    width:parent.height
                    height:parent.height
                    anchors.left:parent.left
                    //source:img_source
                    source:"http://t2.gstatic.com/images?q=tbn:ANd9GcTrUkD2AQtkUmcazQ0P9JCxJBn-_lMHiRI2XdiB5s17ho6dv3UP"
                    onSourceChanged: print("Your image source is : " + img_source)
                }
                Text{
                    id:txt_title
                    anchors.left:thumbnail.right
                    anchors.leftMargin: 5
                    anchors.right: txt_arrow.right
                    anchors.verticalCenter: parent.verticalCenter
                    font.pixelSize: 20
                    elide:Text.ElideMiddle
                    text:img_title
                }
                Text{
                    id:txt_arrow
                    anchors.right: parent.right
                    anchors.rightMargin: 10
                    anchors.verticalCenter: parent.verticalCenter
                    font.pixelSize: 25
                    text:">>"
                }
                MouseArea{
                    anchors.fill: parent
                    onClicked:{
                        console.log("clicked")
                        screen.state = "view"
                        console.log(img_source + " " + img_title)
                    }
                }
            }
        }
        Image{
            id:big_pic
            width:screen.width
            height: screen.width - te_search.height - 10
            fillMode:Image.PreserveAspectFit
            source: "http://www.hq.xinhuanet.com/photo/2013-02/04/114603916_21n.jpg"
            //source: img_source
        }
    }

    CTextInput{
        id:te_search
        y: 321
        height: 31
        anchors.right: btn_search.left
        anchors.left: screen.left
        anchors.leftMargin: 5
        anchors.bottom: screen.bottom
        anchors.bottomMargin: 5
        Behavior on opacity {NumberAnimation{}}
        text:"Search Pics"
    }

    Button {
        id: btn_search
        height: te_search.height
        x: 276
        y: 326
        text: qsTr("Search")
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 0
        Behavior on opacity {NumberAnimation{}}
        anchors.right: screen.right
        anchors.rightMargin: 5
    }

    Button {
        id: btn_back
        height: te_search.height
        x: 276
        y: 326
        opacity: 0
        text: qsTr("<< Back")
        Behavior on opacity {NumberAnimation{}}
        anchors.left: screen.left
        anchors.leftMargin: 5
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 0
        onClicked: screen.state = ""
    }

    Text{
        x: 0
        y: 0
        anchors.top: screen.top
        text:"Tester"
        horizontalAlignment: Text.AlignHCenter
        font.pixelSize: 70
    }
}

[更新]

尝试添加XML支持给你的.pro file

 QT + = xmlpatterns xml

[更新2] 也尝试一下

Projects --->Android kit armeabi-v7 ---> run ---> Deploy configurations 

--->additional libraries --->add  

---> browse toQTpath/.../android_armv7/qml/QtQuick/XmlListModel 

并选择libqmlxmllistmodelplugin.so

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

未找到 qml XmlListModel 插件 的相关文章

随机推荐

  • 获取 127.0.1.1 而不是 192.168.1.* ip ubuntu python

    我是Python新手 我想获取系统的IP地址 我是在局域网中连接的 当我使用下面的代码获取IP时 它显示127 0 1 1而不是192 168 1 32 为什么不显示 LAN ip 那我怎样才能得到我的LAN ip呢 每个教程都只展示这种方
  • 使用 FileStream 创建文件会返回 InvalidOperationException

    它返回exception特别是在line 12 public void saveToXML URL newURL new URL newURL type type newURL name name newURL info info newU
  • Reactor 项目和 Java 内存模型

    我试图了解 Projectreactor 为应用程序代码提供的数据可见性方面的保证 例如我预计下面的代码会失败 但经过一百万次迭代后它不会失败 我正在更改线程 A 上典型 POJO 的状态 并从线程 B 读回它 Reactor 是否保证 P
  • 想要在本机反应中自动滚动平面列表

    我正在尝试自动滚动我的平面列表 但是当我运行代码时 我无法自动滚动 如果我想手动滚动 它会在每 5 秒后到达索引 0 这是我的平面列表及其 refs 函数的所有代码 在构造函数中 this flatList1 null 并在 compone
  • 在 webpack 构建中包含 git commit 哈希值和日期

    我正在使用react es6 webpack 我想在我的应用程序中的某处显示构建日期和 git 哈希值 最好的方法是什么 你可以使用 webpack 的定义插件 https webpack js org plugins define plu
  • WPF 文本块 TargetNullValue 不起作用?

    我有一个 wpf 文本块 如下所示
  • GOTO 仍然被视为有害吗? [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 每个人都知道迪杰斯特拉 Dijkstra 给编辑的信 转到被认为有害的声明 http portal acm org citation cfm d
  • 有没有免费的lib访问html5数据库SQLite?

    该库应该易于使用来访问 html5 本地存储 sqlite 就像定义表 添加 更新 删除实体 从数据库查询实体一样 可能使用该库我可以编写如下代码 code var db new MyDataBase var users db Users
  • 为什么一个能工作,一个崩溃?

    这已经让我抓狂了一个多星期了 下面是游戏中机器人玩家的两段 Lua 代码片段比特战士 http bitfighter org 用 C 编写 使用 LuaWrapper 的变体进行绑定 当我第一次启动 Lua 脚本时 两者都完全按预期工作 但
  • REST批量删除多个项目

    我需要按批处理中的 id 删除多个项目 但是 HTTP DELETE 不支持正文有效负载 解决方案 1 DELETE path abc itemId 1 itemId 2 itemId 3 on the server side it wil
  • 气流相对导入外部 /dag 目录

    我无法将通用代码移至气流使用的 dag 目录之外 我看过气流源 https github com apache incubator airflow blob 4f20f607764bb3477419321b5dfd0c53ba1db3c0
  • 下载并保存 PDF 以供查看

    我正在尝试从我的应用程序下载 PDF 文档并将其显示在 IBooks 中 或者至少在下载完成后使其可供阅读 我按照 Xamarin 的下载示例进行操作 它允许我下载 PDF 并将其保存在本地 它也以错误的编码保存 这是我到目前为止所尝试过的
  • MongoDB NodeJS 返回子文档

    我正在尝试返回与查询字段匹配的子文档 我只想返回与用户匹配的 PIN 该 PIN 保存在帐户集合中 这就是我到目前为止所得到的 router post SelectUser async req res gt try const acc aw
  • 我的网络应用程序应该支持哪个版本的 Internet Explorer (IE) [关闭]

    Closed 这个问题是无关 help closed questions 目前不接受答案 由于 MS 将很快停止支持 IE 8 之前的任何内容 我不确定是否应该使我的网络应用程序与那些旧浏览器兼容 我知道仍然有人在使用它们 但我不知道是否有
  • Android 音频播放的广播意图?

    我正在尝试构建一个 Android 应用程序 它使用广播接收器来检测音乐播放何时开始 然后提供手势控制来触发发送跳过曲目意图 首先 我只想将接收器设置为在音频播放开始时触发通知 以便我可以检查这个概念是否有效 我已经在清单文件中声明了一个服
  • 如何在Python中查找n天前的日期?

    我想写一个脚本 给Python几天的时间 我们称之为d 它给了我我们的日期d几天前 我正在努力处理模块日期时间 import datetime tod datetime datetime now d timedelta days 50 a
  • Java Swing Shift+F10 辅助功能

    Per accessibility requirements Shift F10 is supposed to open right click context menus In Swing one approach is to just
  • 发送电子邮件时出现 SmtpException

    我正在尝试通过我的 C 代码发送电子邮件 但我得到SmtpException 连接尝试失败 因为连接方在一段时间后没有正确响应 或者建立的连接失败 因为连接的主机未能响应 173 194 67 109 587 这是我发送电子邮件的方式 st
  • Ansible 清单可以包含另一个清单吗?

    我们有一组在应用程序的不同实例之间共享的服务器 并希望它们的列表是一个单独的文件 以及其他特定于实例的清单包括 it 我知道 这可以通过dynamic库存 但这些是代码 我们希望保留我们的服务器列表data 可以这么说 对于 INI 库存
  • 未找到 qml XmlListModel 插件

    在我的项目中 我尝试使用 qml 内置的 Xml 列表模块 但是当我编译到手机时 出现此错误 W Qt 20100 assets qml FlickrDemo main qml 4 null assets qml FlickrDemo ma