View Full Version : xml + sqlite

7th May 2009, 17:55
Hi, I was wondering. Do you guys think this is a good idea (so it doesn't require a lot of work and is portable):

I have to read and parse xml...which I have to represent to the user in some sort of QTableWidget...then the user has to be able to edit some of the data (values of elements of XML)... and then I have to store the changed data in the the XML form again.

So my ideas is this: I would create a virtual sqlite database (that would only be present in memory), create some database, and save the XML data in the database table...then this is easily represented by QSqlRelationalTableModel which also enables me to change data...so the changed data would be stored in a database...which I would only have to parse back into xml file when I'm done.

So, did I miss something crucial, so that the whole idea is not so good? Or is it a lot more complicated than it seems to be?

Any thoughts are welcome.

7th May 2009, 18:06
Well if you not familiar with the model-view concept (http://doc.trolltech.com/4.5/model-view-programming.html) of Qt there is some work to spend to learn it but then that would be the best solution: Write your own model for your xml files and display them in a QTabelView, edit them via your own delegate class and chance all direct in your QDomDocument.