PDA

View Full Version : XML display in Qt



aamer4yu
5th November 2007, 12:07
Is there a way to display XML in Qt ?
Searched QTextBrowser, but not able to find anything related.
Need to display XML as it appears in Internet explorer. Simple tree structure can be created.

Nebody know a way how to do it ??

momesana
5th November 2007, 12:11
If you mean:
Qt provides means to parse xml files. You can use these facilities to create an own tree from that using QTreeView.

read this: http://doc.trolltech.com/4.3/qtxml.html#details

jpn
5th November 2007, 14:25
Take a look at Simple DOM Model Example (http://doc.trolltech.com/latest/itemviews-simpledommodel.html).

aamer4yu
6th November 2007, 03:35
Ya had seen it.
But what i wanted actually is a display like the XML in IE . with colored attributes etc.
Is there any compoonent or class in Qt ??

jpn
6th November 2007, 07:23
I'm afraid there's nothing readily available in Qt for that. Take a look at http://wiki.qtcentre.org/index.php?title=XmlHighlighter (just be aware that it's buggy).

aamer4yu
7th November 2007, 06:36
thanx for the same...
i used a work around... used a IE component in QAxWidget :D

Brandybuck
7th November 2007, 17:54
thanx for the same...
i used a work around... used a IE component in QAxWidget :D
But then it's two to three times as big as it should be, and you lose all cross platform.

stevey
7th November 2007, 20:37
Surely this standard Trolltech example that ships with Qt is what you want.
http://doc.trolltech.com/4.3/xml-saxbookmarks.html

It's not identical to the IE styling but it would get you 90% of the way there.