Export StandardItemModel to XML
Hi!
I need to export a QStandardModelItem to an XML-File.
Code:
//put stuff inside
//then walk through the childs using
exportChild(item,out) ;
//writing the XMLFile using recursion of exportChild()
exportChild()
{
if (item->hasChildren())
...
exportChild(item,out)
}
Is this the best way to do that or is there an easier or better solution?
Kind regards,
HomeR
Re: Export StandardItemModel to XML
Recursion sounds good. But I would write two functions above like and "hide" the child function.
The absolutely best way would be to write a custom model which works direct with the xml file, but that is a quite a lot of work and for a small case it might be overkill.
Re: Export StandardItemModel to XML
Thank you, this sounds good. I wil capsule the details and write a clean class to export the model.