[PyKDE] contextMenuEvent for QTableView column headers

N. Volbers mithrandir42 at web.de
Sun Jan 14 21:20:12 GMT 2007


Hello everyone,

I am relatively new to pyQt and I have a question regarding the 
QTableView.  I have derived a view class from QTableView class and I 
have implemented a context menu by adding a method like this:

     def contextMenuEvent(self, event):
	self.datasetMenu.exec_(event.globalPos())

where datasetMenu is a Menu I have created in the constructor.

This works very nicely, but I noticed that the popup will only be 
created when clicking inside of the tableview. However, I would like to 
present a context menu when the user clicks on the column header.

What can I do to achieve this?

Niklas Volbers.




More information about the PyQt mailing list