Hello,

i want to create a list based on a model c++ , this model is contains a different data type , and i want to display just one type , so i used DelegateModelGroup.
i want to know the index of the items in the list in the filtred Model and his index in the origin model , i tried DelegateModel.itemsIndex and DelegateModel.persistedItemsIndex properties , itemsIndex return the index in the groupedmodel but persistedItemsIndex return always 0.

Qt Code:
  1. DelegateModel {
  2. id: displayDelegateModelFavoris
  3. delegate: Item {
  4. id: resultDelegateMainItem
  5.  
  6. MouseArea {
  7. anchors.fill: parent;
  8. onClicked:{
  9.  
  10. console.log("**************visualindex*********",resultDelegateMainItem.DelegateModel.itemsIndex)
  11. console.log("**************firstIndex*********",resultDelegateMainItem.DelegateModel.persistedItemsIndex)
  12.  
  13. }
  14. }
  15. }
  16.  
  17. }
  18. model: docModel
  19. groups: [
  20. DelegateModelGroup {
  21. includeByDefault: false
  22. name: "favoris"
  23. }
  24. ]
  25. filterOnGroup: "favoris"
  26. Component.onCompleted: {
  27. var rowCount = docModel.size();
  28. items.remove(0,rowCount);
  29. for( var i = 0;i < rowCount;i++ ) {
  30. var entry = docModel.get(i);
  31. if(entry.BookDocumentType === BookDocumentType.Bookmark) {
  32. items.insert(entry, "favoris");
  33. }
  34. }
  35. }
  36. }
  37. ListView {
  38. id: favorisList
  39. clip: true
  40. width: settings.width;
  41. height: 600
  42. model: displayDelegateModelFavoris
  43. }
To copy to clipboard, switch view to plain text mode 

Can any one help me please ?