在QML文件中使用XmlListModel时,编译成桌面版时没有任何问题,但是编译并部署到Android模拟器时却报错:
module "QtQuick.XmlListModel" plugin "qmlxmllistmodelplugin" not found
官方给出的解释是:
Creator in 3.0 can't detect dependencies in the qml files. There's a tool in development to fix that and hopefully we can make use of that in the future.
官方给出的解决方法是:
In your case linking your application against xmlpatterns makes it work. Add QT+=xmlpatterns to the .pro file and ensure that it links again. (qmake doesn't link if you only change the .pro file.)
即在pro文件中加入 QT += xmlpatterns, 并且需要重新编译连接项目