Have you met a load problem of XmlListModel in an embedded platform
-
I want to call the do_xmldata_work() function from some other qml file.
When I do this:- On desktop
it will output as follows:
bq. do_xmldata_work begin>:
loading xml file: 1 || finished- on Qtembedded platform
it will output:
bq. do_xmldata_work begin>:
loading xml file: 2
loading xml file: 2
loading xml file: 2
loading xml file: 2
loading xml file: 2
loading xml file: 2
loading xml file: 2
... - On desktop
-
I can't tell whats going wrong :( . The xml file seems to be found by XmlListModel, but my suspicion goes to the function do_xmldata_work(). Can you add in XmlListModel element this code and comment out the content of that function:
@
if (status === XmlListModel.Ready) console.log("XmlListModel.Ready ", count);
if (status === XmlListModel.Loading) console.log("XmlListModel.Loading");
if (status === XmlListModel.Error) console.log("XmlListModel.Error: ", errorString);
if (status === XmlListModel.Null) console.log("XmlListModel.Null");@ -
Do you means that change
@function do_xmldata_work()
{
console.log("do_xmldata_work begin>: ")
while(xmlModel.status != XmlListModel.Ready)
console.log("loading xml file: " + xmlModel.status)
console.log("loading xml file: " + xmlModel.status + " || finished")... }@
into
@function do_xmldata_work()
{
console.log("do_xmldata_work begin>: ")
//while(xmlModel.status != XmlListModel.Ready)
// console.log("loading xml file: " + xmlModel.status)
if (status === XmlListModel.Ready) console.log("XmlListModel.Ready ", count);
if (status === XmlListModel.Loading) console.log("XmlListModel.Loading");
if (status === XmlListModel.Error) console.log("XmlListModel.Error: ", errorString);
if (status === XmlListModel.Null) console.log("XmlListModel.Null");console.log("loading xml file: " + xmlModel.status + " || finished") ... }@
-
oh sorry. I forgot to write the signal. I mean this:
@XmlListModel {
id: xmlModel
....
onStatusChanged: {
if (status === XmlListModel.Ready) console.log("XmlListModel.Ready ", count);
if (status === XmlListModel.Loading) console.log("XmlListModel.Loading");
if (status === XmlListModel.Error) console.log("XmlListModel.Error: ", errorString);
if (status === XmlListModel.Null) console.log("XmlListModel.Null");
}}@
and do not call do_xmldata_work() function. Just for testing and see if the xml file has problems
-
OK, I will try, it may cost some time on both platforms
Thank you very much. -
Using
@ XmlListModel {
id: xmlModel
....
onStatusChanged: {
if (status === XmlListModel.Ready) console.log("XmlListModel.Ready ", count);
if (status === XmlListModel.Loading) console.log("XmlListModel.Loading");
if (status === XmlListModel.Error) console.log("XmlListModel.Error: ", errorString);
if (status === XmlListModel.Null) console.log("XmlListModel.Null");
}}@
-
On desktop: Only one line output
@XmlListModel.Loading
XmlListModel.Ready 4@ -
On Qtembedded: Only one line output
@XmlListModel.Loading@
-
-
It seems that on Qtembedded platform, that the loading never finished.
Why, am I using the the wrong path of the xml file? -
bq. Why, am I using the the wrong path of the xml file?
That was my first thought, but if XmlModelList doesn't find the file an Error or Null signal should be emitted. You also can try to store the xml file in a known directory and set the source property with the full path.
What is your embedded platform ? -
I have tried the absolute path before, it will output all the same.
In fact, I do not know what my embedded platform is.
I only know that the toolchain is from freescale,
for that the compiler is called as "arm-fsl-linux-gnueabi-g++" with a "fsl", I guessed that it was a freescale platform.
Maybe iMx53 serials. But I do not know exactly.If this is a bug, where the bug is locating in your mind.
In the "qmlapplicationviewer" source in my project,
or somewhere underneath in the Qt framework? -
with a wrong path
@source: "errorxmldata.xml"@
on Desktop outputs
@XmlListModel.Loading
XmlListModel.Error: [object Object]@while on Qtembeded platform
@XmlListModel.Loading
XmlListModel.Error: [object Object]@The same as you thought.
-
Sorry but I have no more suggestions.
I searched if there is some on "bugreports":https://bugreports.qt-project.org but didn't found any. You can try there to file a new bug reporting on which platform you find it.good luck