I have a QTabWidget, and I need to trigger an event when i press the area on the tab widget where you normally would see the tab name, accept its an empty space with no tab.
Clicking the red area should trigger an event:
Here is how the result should look like:


You could install an event filter on your
QTabWidget, and useQMouseEventposition to detect if it's on the empty space after the tab bar, and add tabs there.There are many ways you can detect that, here's one of them:
Here's how it looks, I'm clicking on different areas to test that it only adds a tab when clicked on the space after the tab bar:
Notes:
QCursor::pos()instead ofQMouseEvent, but you'll need to map positions.