PDA

View Full Version : How to parse this XML and append in QTreeWidget?



Gokulnathvc
29th January 2013, 09:55
<?xml version="1.0" encoding="utf-8"?>
<relation version="1.0">
<Friends>
<first name="ravi"></first >
<display name="ravi kumar"></display>
</Friends>
<Friends>
<first name="balaji "></first >
<display name="arun balajir"></display>
</Friends>
<Friends>
<first name="kumar"></first >
<display name="kokki kumar"></display>
</Friends>

</relation >


How to parse this xml and retrieve first name and display name. And I want to show only display name in QTreeWidget and if user clicks on the display name, the value to be used should be corresponding first name.. How to achieve this??

lanz
29th January 2013, 10:07
Take a look at this example:
http://qt-project.org/doc/qt-4.8/xml-dombookmarks.html