1
我在QML使用XmlListModel:錯誤:XmlListModel不是一個類型
的XML:
<? xml version="1.0" ?>
<queuelist>
<queue id="1" name="name" image="image.svg" turn="34" wait="50" />
</queuelist>
的XmlListModel
XmlListModel {
id: queueModel
source: "queuelist.xml"
query: "/queuelist/queue"
XmlRole {name: id; query: "@id/string()"}
XmlRole {name: queue; query: "@name/string()"}
XmlRole {name: image; query: "@image/string()"}
XmlRole {name: turn; query: "@turn/string()"}
XmlRole {name: wait; query: "@wait/string()"}
}
的QTCreator錯誤:
file:///home/(...)/3queue-client-list.qml:42 XmlListModel is not a type
/home/(...)/Qt5.0.1/5.0.1/gcc/bin/qmlscene exited with code 255