[Solved] XmlListModel, set source from C++ QByteArray
-
Hi all, I have a QByteArray in C++ with the content of an xml file.
I expose the QByteArray to QML:
@
QByteArray elenco_satelliti;
...
...
m_qmlViewer->rootContext()->setContextProperty("elencoSatelliti", elenco_satelliti);
@Now I'd like to use the QByteArray as XmlListModel "source":
@
XmlListModel {
id: elencoSatellitiModel
source: elencoSatelliti
query: "/satelliti/satellite"XmlRole { name: "idSatellite"; query: "id/string()" } XmlRole { name: "descrizioneSatellite"; query: "descrizione/string()" } }
@
but setting the source this way doesn't works...
Is it possible?