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?

example.jpg

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?