Hi Qt Masters,

I'm having problem displaying a rectangle when pressing and holding on selected delegate item.

Qt Code:
  1. Item {
  2. id: listItem
  3.  
  4. anchors {
  5. top: oparent.top
  6. left: parent.left
  7. right: parent.right
  8. bottom: parent.bottom
  9. }
  10.  
  11. ListView {
  12. id: list
  13.  
  14. anchors.fill: parent
  15.  
  16. currentIndex: -1
  17. clip: true
  18.  
  19. model: itemModel
  20. delegate: ItemDelegate {
  21. MouseArea {
  22. id: area
  23. anchors.fill: parent
  24. onPressAndHold: {
  25. menu.showed = true
  26. menu.x = mouseX
  27. menu.y = mouseY
  28. }
  29. }
  30. }
  31. boundsBehavior: Flickable.StopAtBounds
  32.  
  33. CustomMenu {
  34. id: menu
  35.  
  36. z: 100
  37.  
  38. parent: list
  39.  
  40. model: menuModel
  41. }
  42. }
  43. }
To copy to clipboard, switch view to plain text mode 

In the code above, it returns only the mouse coordinates on selected item that is why the menu always showed on top part of the Item.
When I tried putting mousearea on listItem, the ListView will not work.

Please advice, thanks.