Thank you for your answer.

Originally Posted by
anda_skoa
I am not sure what you expect to see.
You tell the TableViewColumn to use "col1" as the role, yet your data has no "col1", it has "newName" and "newValue".
_
I have this XML file:
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<record prop1=".." prop10="..." />
.......
<record prop1=".." prop10="..."/>
</NewDataSet>
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<record prop1=".." prop10="..." />
.......
<record prop1=".." prop10="..."/>
</NewDataSet>
To copy to clipboard, switch view to plain text mode
And I have a TableView with this columns:
prop1, .... , prop10
I want to use newName for name of columns(name=prop1 , .. , prop10) and newValue for value of attributes in XML file.
I do not see any record in tableview.

Originally Posted by
anda_skoa
So, from your point of view, which of these tw comparions should be true?
"col1" == "newName"
"col1" == "newValue"
"col1" == "newName"
"col1" == "newValue"
To copy to clipboard, switch view to plain text mode
_
Excuse me, you are right. I mistake to write code here. I put "newDataList.append(new DataObject("name of column ==for example prop1", attr.value().toString())); " for test.
I can display my XML file using XmlListModel in Tableview, but I can not save all record of Tableview in XML file by using XmlListModel.
I write another code by using QAbstractTableModel, but I do not see any data after open XML file in Tableview.
If you are agree I want to put a another sample program by QAbstractTableModel.
Bookmarks