Hi forum

I'm trying to use ComboBox inside Listview. I can't access to ComboBox model outside Listview

Qt Code:
  1. Window {
  2. visible: true
  3.  
  4. //...
  5.  
  6. Button {
  7. text: qsTr("Connect")
  8. onClicked:{
  9. apeWindowCmpst.visible = true
  10.  
  11. var code = "90"
  12. var label = "doc"
  13. console.log("code : "+code+" - label : "+label)
  14. listAddApeCmpst.model.append({ "code":code ,
  15. "libelle":label
  16. });
  17.  
  18. modelAPECmpst.append({"name":code}) // can't acces to modelAPECmpst
  19.  
  20. }
  21. }
  22.  
  23. Window {
  24. id:apeWindowCmpst
  25. ...
  26.  
  27.  
  28. ListView{
  29. id:listAddApeCmpst
  30. model: addApeModelCmpst
  31. ...
  32.  
  33. delegate:
  34. Rectangle {
  35. id :rectApeCmpst
  36. ...
  37.  
  38. Item{
  39. id: itmCmpst
  40. anchors.left: parent.left
  41. anchors.leftMargin: 10
  42. height: parent.height-100
  43. width: parent.width-50
  44. Grid{
  45. id:gridAPEActCmpst
  46. anchors.fill: parent
  47. ...
  48.  
  49. ListModel {
  50. id: modelAPECmpst
  51. }
  52. ComboBox{
  53. id:pApeListCmpst
  54. editable: true
  55. width: listAddApeCmpst.width/3*2-36
  56. height: 33
  57. textRole: "name"
  58. model: modelAPECmpst
  59. ...
  60.  
  61. }
  62. ListModel {
  63. id: modelLabelAPECmpst
  64. }
  65. ComboBox{
  66. id:pLabelApeListCmpst
  67. editable: true
  68. width: listAddApeCmpst.width/3*2-36
  69. height: 40
  70. textRole: "name"
  71. model: modelLabelAPECmpst
  72. ...
  73. }
  74.  
  75. }
  76. }
  77. }
  78. }
  79. ListModel {
  80. id: addApeModelCmpst
  81. }
  82. }
  83.  
  84. }
To copy to clipboard, switch view to plain text mode 

>> delagate is a dynamic structure

I want to display values in ComboBox ??

Screenshot from 2016-10-21 12:11:58.png

Regards;