KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
TabBar Class Reference

QTabBar subclass that emits a context-menu signal for individual tab indices. More...

#include <tabbar.h>

+ Inheritance diagram for TabBar:
+ Collaboration diagram for TabBar:

Signals

void tabCustomContextMenuRequested (int index)
 Emitted when the user right-clicks a tab.
 

Public Member Functions

 TabBar (QWidget *parent=nullptr)
 Construct with an optional parent.
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event) override
 Intercept right-click presses to emit the context-menu signal.
 

Detailed Description

QTabBar subclass that emits a context-menu signal for individual tab indices.

TabBar intercepts right-click events and emits tabCustomContextMenuRequested() with the index of the tab under the cursor, allowing callers to show a per-tab context menu without subclassing further.

Definition at line 14 of file tabbar.h.

Constructor & Destructor Documentation

◆ TabBar()

TabBar::TabBar ( QWidget *  parent = nullptr)
explicit

Construct with an optional parent.

Parameters
parentOptional QWidget parent

Member Function Documentation

◆ tabCustomContextMenuRequested

void TabBar::tabCustomContextMenuRequested ( int  index)
signal

Emitted when the user right-clicks a tab.

Parameters
indexLogical index of the tab that was right-clicked

The documentation for this class was generated from the following file: