View Full Version : Context menu on tab header

20th July 2019, 01:23
I currently have a tabwidget for which I connected its customContextMenuRequested signal to a slot that shows a context menu.

The context menu shows up, but it shows up through the entire area of the tab.

How do I make it so that the right click opens only when I click on the tab title bar?


Sorry for the rough diagram. Currently, my context menu is triggered in the green and blue regions. How do I isolate it to the green region alone?

20th July 2019, 08:52
Maybe connect to the QTabBar's signal instead?