Hello!

I am trying to access an alias from an Item and it is not working. Can anyone help me?

In main.qml, when I try DelegateLancamentos.removeMouseArea: it returns this message:
qrc:/DelegateLancamentos.qml:10 Invalid alias reference. Unable to find id "removeMouseArea"

Code below:

MainForm.ui.qml
Qt Code:
  1. Rectangle {
  2. id: mainContainer
  3.  
  4. property alias lancamentosListView: lancamentosListView
  5.  
  6. width: 360
  7. height: 640
  8.  
  9. ListView {
  10. id: lancamentosListView
  11.  
  12. anchors.fill: parent
  13.  
  14. clip: true
  15.  
  16. spacing: 10
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 

ModeloLancamentos.qml
Qt Code:
  1. ListModel {
  2. ListElement {
  3. valor: "25.000,00"
  4. tipo: "Investimento"
  5. }
  6. }
To copy to clipboard, switch view to plain text mode 

DelegateLancamentos.qml
Qt Code:
  1. Item {
  2. id: delegateItem
  3.  
  4. property Component delegateComponent: delegateComponent
  5. property alias removeMouseArea: removeMouseArea
  6.  
  7. Component {
  8. id: delegateComponent
  9.  
  10. Row {
  11. Column {
  12. width: 360 * 0.96 / 8 * 6
  13. //width: Screen.width * 0.96 / 8 * 6
  14.  
  15. Text {
  16. text: "<strong>" + "Valor: " + valor + "</strong>"
  17. font.pixelSize: 16
  18. }
  19. Text {
  20. text: "Tipo: " + tipo
  21. font.pixelSize: 16
  22. }
  23. }
  24.  
  25. Column {
  26. width: 360 * 0.96 / 8
  27. //width: Screen.width * 0.96 / 8
  28.  
  29. Image {
  30. id: removeImage
  31. source: "Imagens/remove.png"
  32.  
  33. width: 35
  34.  
  35. fillMode: Image.PreserveAspectFit
  36.  
  37. MouseArea {
  38. id: removeMouseArea
  39.  
  40. anchors.fill: parent
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
To copy to clipboard, switch view to plain text mode 

main.qml
Qt Code:
  1. Window {
  2. visible: true
  3.  
  4. width: 360
  5. height: 640
  6.  
  7. maximumHeight: 640
  8. minimumHeight: 640
  9.  
  10. maximumWidth: 360
  11. minimumWidth: 360
  12.  
  13. title: "InvestmentC-Mobile"
  14.  
  15. MainForm {
  16. anchors.fill: parent
  17.  
  18. mainContainer.width: parent.width
  19. mainContainer.height: parent.height
  20.  
  21. lancamentosListView.model: modeloLancamentos
  22. lancamentosListView.delegate: delegateLancamentos.delegateComponent
  23.  
  24. DelegateLancamentos.removeMouseArea:
  25. {
  26. modeloLancamentos.remove(index);
  27. }
  28. }
  29.  
  30. ModeloLancamentos{
  31. id: modeloLancamentos
  32. }
  33.  
  34. DelegateLancamentos {
  35. id: delegateLancamentos
  36. }
  37. }
To copy to clipboard, switch view to plain text mode