I need from c + + now use QAbstractItemlModel QAbstractIListModel to QML and (or) data, implement group, the group included in the group name, group of friends including (head, nicknames, account information), the equivalent of two model, at the moment, I will only a model, not add child model, hope bosses for help
CodePudding user response:
Reply, if effective, can be paid
CodePudding user response:
Can combine the two model into a new model for display
CodePudding user response:
Simple - Soft references 2 floor response: can combine two model into a new model for display inside the Means the two model needs to be inherited QAbstractListModel? CodePudding user response:
Inheritance is very simple, is to build model for presentation, future expansion convenient also, maybe in the future we also shows other properties CodePudding user response:
this is my current data structure can be say that specific point, please CodePudding user response:
refer to 4th floor, Simple, Soft reply: inheritance is very Simple, is to build model for presentation, future expansion is also convenient, maybe in the future we also shows other attribute The image below may have a look CodePudding user response:
You MyData store it is good to those who need to display the data, whether it is a group name, or the user information, can be CodePudding user response:
like this CodePudding user response:
reference 7 floor is Simple - Soft reply: MyData you store it is good to those who need to display the data, whether it is a group name, or the user information, can Isn't it look at the following pictures CodePudding user response:
I think it should be no problem, you try it on CodePudding user response:
The references to the tenth floor Simple - Soft reply: I think it should be no problem, you try I do this before but I don't know how to read on the QML end value of the second children CodePudding user response:
11 references manjaro21 response: Quote: reference to the tenth floor Simple - Soft reply: I think it should be no problem, you try it I do this before but I don't know how to read the second on the QML end values in children You take a look at this link https://blog.csdn.net/wei375653972/article/details/77986870 CodePudding user response:
Ok I see thank you