[Interest] Display XML in tree view

Jason H jhihn at gmx.com
Wed Aug 3 15:50:14 CEST 2016


> Sent: Tuesday, August 02, 2016 at 11:36 AM
> From: "Murphy, Sean" <smurphy at walbro.com>
> To: "interest at qt-project.org" <Interest at qt-project.org>
> Subject: [Interest] Display XML in tree view
>
> I'm assuming this solution already exists, but either my google-fu isn't working today, or it doesn't: I'd like to display an XML in a tree view, much like many XML editing software applications do. All I'm looking for is display the raw XML in a read-only tree view, but have the nodes be hierarchical so that while looking at the XML, I can collapse/expand nodes. 
> 
> I have to believe this is already out there, but I'm just not stumbling across it...

I don't think anything exists already. TreeViews sure, XML sure. Combining the two though, no.  But I don't think it would be hard. Qt's model/view system should make it trivial. The only decisions are:
1. Stream Reader interface or classic DOM parsing (both supported by Qt)
2. Arrange the data as columns or roles. 

Once you have your model and parsing, then you can use it in a QTreeView.



More information about the Interest mailing list