07-12-2013 11:53 AM - edited 07-12-2013 01:31 PM
I am using XmlDataAccess class to load an XML list into GroupDataModel. Everything works fine if the XML file has more than one member, however, it fails to load if the list has a single member. I'm using the following code to obtain the XML contents:
QVariant list = xda.load(home.absoluteFilePath("MembersList.xml"),
I need to know if the list has only one, or 2+ members, so I can direct the data model to load with appropriate parameters. Can I find out the number of members in the list?
This problem is closely related to this issue, where a QML solution is given.
Solved! Go to Solution.
07-22-2013 04:32 PM - edited 07-23-2013 01:00 PM
Please see this forum post for a workaround to this issue. I have tested it and confirm it works like the QML case.
07-22-2013 05:23 PM
Thanks Samar, confirmed, this fixed the issue. The supplied link contains the fix, but not in the post that was accepted as solution, but in a post below it (containing "isEmpty()" reference) - perhaps that should be updated to avoid confusion.