How to merge/append a portion of QStandardItemModel list to an existing list item;
hello everyone
i made a model and treeview list according to the model/view tutorial, suppose the list structure is as following(each indent indicates a child level):
item1
a
item2
b
c
how can i take item2 as a pointer or whatever and append it item1 as a child, and still the item2 retains all its childrens, so I want to do this:
item1
a
item2
is there a way to do this? thank you.
Re: How to merge/append a portion of QStandardItemModel list to an existing list item
Re: How to merge/append a portion of QStandardItemModel list to an existing list item
hi wysota
takeItem() returns a QStandardItem, does it retain all the children? also insertRow() needs a QList<QStandardItem*> as the second argument. how do I fit the Item in there?
Re: How to merge/append a portion of QStandardItemModel list to an existing list item
Quote:
Originally Posted by
startyourengine
takeItem() returns a QStandardItem, does it retain all the children?
Why don't you just try and see for yourself?
Quote:
also insertRow() needs a QList<QStandardItem*> as the second argument. how do I fit the Item in there?
There are three variants of this method.
Re: How to merge/append a portion of QStandardItemModel list to an existing list item
ah, it worked. Thanks a bunch!