I have ListView and i use mouse coordinate check and get index, item from ListView. I use listView.indexAt(x,y), listView.itemAt(x,y), in normal ListView i get them successfully but in ListView i add verticalLayoutDirection: ListView.BottomToTop, listView.indexAt(x,y), listView.itemAt(x,y) can't get value.
How i can get indexAt, itemAt correct?

Qt Code:
  1. ListView {
  2. id:list
  3. anchors.fill: parent
  4. interactive: false
  5. verticalLayoutDirection: ListView.BottomToTop
  6. MouseArea {
  7. id:mous
  8. anchors.fill: parent
  9. onPositionChanged: {
  10.  
  11. var positionInRoot = mapToItem(list, mouse.x, mouse.y)
  12.  
  13. var index = list.indexAt(positionInRoot.x,positionInRoot.y) // is not correct when use verticalLayoutDirection: ListView.BottomToTop
  14. var item = list.itemAt(positionInRoot.x,positionInRoot.y) // is not correct when use verticalLayoutDirection: ListView.BottomToTop
  15.  
  16. }
  17. }
To copy to clipboard, switch view to plain text mode