Str Anger
3rd June 2016, 15:48
Hi everyone !
I have navigated through the Internet all day to find an answer to my question, but it seems that the answer is too obvious to be posted on the web. So here it is :
How do I set custom items to my custom models ?
I have been on the Qt Doc page related to the QAbstracItemModel, and have no clue on which methods to call to let the model know I created new rows (tried beginInsertRows() / insertRow () / endInsertRows() but it did not seem to have any effect) and even if I would have succeeded, how will the model know that he has to check on my QList<MyCustomItem *> to populate himself (and create the QModelIndexes that I'll need to use afterwards).
I hope I have been clear enough on my questions (I could have linked my code, but it is quite long).
I thank you for any answer, and am sorry for my poor english.
I have navigated through the Internet all day to find an answer to my question, but it seems that the answer is too obvious to be posted on the web. So here it is :
How do I set custom items to my custom models ?
I have been on the Qt Doc page related to the QAbstracItemModel, and have no clue on which methods to call to let the model know I created new rows (tried beginInsertRows() / insertRow () / endInsertRows() but it did not seem to have any effect) and even if I would have succeeded, how will the model know that he has to check on my QList<MyCustomItem *> to populate himself (and create the QModelIndexes that I'll need to use afterwards).
I hope I have been clear enough on my questions (I could have linked my code, but it is quite long).
I thank you for any answer, and am sorry for my poor english.