Coordinate transformations might be tricky...Here is a code snippet i used long time ago...and the thing is that i'm not sure if i figured it out completely back then...cuz i had the same problem.

Qt Code:
  1. //..
  2.  
  3. view = new QTableView;
  4.  
  5. // ...
  6.  
  7. void Widget::customContextMenuRequested(const QPoint &point)
  8. {
  9.  
  10. QModelIndex index = view->indexAt(point);
  11.  
  12. if( index.isValid() )
  13. {
  14.  
  15. QPoint viewPortPosition = view->pos();
  16.  
  17. int headerOffset = view->horizontalHeader()->sectionSize(0);
  18.  
  19. int adjustedHeight = viewPortPos.y() + headerOffset;
  20.  
  21. viewPortPos.setY(adjustedHeight);
  22.  
  23. QMenu menu;
  24.  
  25. // ...
  26.  
  27. menu.exec( mapToGlobal(QPoint( viewPortPos + point ) ) );
  28.  
  29. }
  30.  
  31. }
To copy to clipboard, switch view to plain text mode 

Even thought i've used QTableView , i'm sure it's gonna give you an idea...If you find that there is something wrong with my implementation (i'm sure there is) , i'd be glad to hear the right way to do it!^^