Problem: I’m looking example about creating model ( based on QAbstractItemModel ) to QTreeView, but can’t find sane codes. Qt examples are based on QStandardModel, which is not very useful and complex, Internet examples are based on python?! codes… Other information can’t gave me the right directions to go. So, here is what I have:
-
std::maptypedef std::map< CompanyData, std::vector< ContractorData >, LessData< CompanyData > > Companies;
Here it’s data example (CompanyName + ContractorsNames):
[Microsoft]*
[Bill Gates]
[Steve Balmer]
[...]
[Apple]*
[Steve Jobs - R.I.P.]
[Wozniak]
[OtherStuff]*
...
where * means – expandable item (parent)
And all that I need it to create QTreeView with this data above!
Can any one help?
Many thanks!
So, as no posts was done here, I post here my own solution (also used text filtering):
PS: type
Companiesis awhere
CompanyData,ContractorsDataare simple structures…Have a nice day!