-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabmanager.h
More file actions
36 lines (27 loc) · 824 Bytes
/
Copy pathtabmanager.h
File metadata and controls
36 lines (27 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef TABMANAGER_H
#define TABMANAGER_H
#include <QtWidgets/QTabWidget>
#include <QtCore/QUrl>
class BrowserTab;
class TabManager : public QTabWidget {
Q_OBJECT
public:
explicit TabManager(QWidget *parent = nullptr);
BrowserTab *createTab(const QUrl &url = QUrl());
[[nodiscard]] BrowserTab *currentTab() const;
[[nodiscard]] BrowserTab *tabAt(int index) const;
void closeTab(int index);
void closeCurrentTab();
signals:
void currentTabChanged(BrowserTab *tab);
void tabCreated(BrowserTab *tab);
void tabClosed(int index);
void lastTabClosed();
private slots:
void onCurrentChanged(int index);
void onTabCloseRequested(int index);
void onTabTitleChanged(const QString &title);
private:
void connectTabSignals(BrowserTab *tab);
};
#endif // TABMANAGER_H