KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
tabwidget.h
1#ifndef TABWIDGET_H
2#define TABWIDGET_H
3
4#include <QTabWidget>
5#include <Kanoop/gui/libkanoopgui.h>
6
7/**
8 * @brief QTabWidget subclass that emits a per-tab context-menu signal.
9 *
10 * TabWidget connects the tab bar's customContextMenuRequested signal to an
11 * internal handler that maps the click position to a tab index and re-emits
12 * tabCustomContextMenuRequested() with that index.
13 */
14class LIBKANOOPGUI_EXPORT TabWidget : public QTabWidget
15{
16 Q_OBJECT
17public:
18 /**
19 * @brief Construct with an optional parent.
20 * @param parent Optional QWidget parent
21 */
22 explicit TabWidget(QWidget *parent = nullptr);
23
24signals:
25 /**
26 * @brief Emitted when the user right-clicks on a tab.
27 * @param index Zero-based index of the tab that was right-clicked
28 */
30};
31
32#endif // TABWIDGET_H
QTabWidget subclass that emits a per-tab context-menu signal.
Definition tabwidget.h:15
void tabCustomContextMenuRequested(int index)
Emitted when the user right-clicks on a tab.
TabWidget(QWidget *parent=nullptr)
Construct with an optional parent.