Hi,
Is there any class where I can directly match the xml contents into QStandardItemModel ? Or do i need to do it by QDomDocument? Thanks for your help.
Hi,
Is there any class where I can directly match the xml contents into QStandardItemModel ? Or do i need to do it by QDomDocument? Thanks for your help.
Why do you want to convert one model to another one? Isn't it better to write a model that will operate directly on the xml structure?
Actually I need to parse the webpage, extract table, and need to do processing on the contents of it. May be display it as tablemodel, treemodel.
Now, I am following the straight forward approach of loading the html page using QDomDocument and trying to parse using node, elements. I am trying figure out is there any more elegant way of doing this.
Yes, that's true. But you don't have to copy the data anywhere. If you have the data somewhere (like in the xml document) just wrap the data in the QAbstractItemModel interface. If you're only after showing the data then Qt comes with an example that creates a read-only model around QDomDocument.
Bookmarks