I have a horizontal header and I’m setting it up to catch right clicks like so:
self.horizontalHeader.setContextMenuPolicy(Qt.CustomContextMenu)
self.horizontalHeader.customContextMenuRequested.connect(self.callFilter)
I’d like to know which column of the header the right-click landed on. I can get the positions through self.horizontalHeader.viewport() but I’m stuck there. Translating the position from the header to the position in the header’s table seems inelegant. Is there a better way to capture the right click, or a better way for find where it landed?
logicalindexAtwill return column number, in case it’s horizontal header: