[PyQt] Context menu on items in QTreeView

Filip Gruszczyński gruszczy at gmail.com
Tue Oct 14 21:30:03 BST 2008


Hello,

I would like to pop up a menu on items in QTreeView. I decided to
intercept pressed(const QModelIndex&) signal, because contextMenuEvent
doesn't provide information about the tree view chosen index. However,
inside the slot for this signal I cannot acces position of the mouse
(no event) and decide, where to pop this menu. I tried browsing
QApplication class, but found no information about the global mouse
position (though there is global information about buttons pressed).
Is there anyway to obtain it and popup menu in the right place?

-- 
Filip Gruszczyński



More information about the PyQt mailing list