aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/webviewtabbar.h
blob: f4fc6e483d4bea108e7be79139c5499ced3aa02d (plain)
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
#ifndef WEBVIEWTABBAR_H
#define WEBVIEWTABBAR_H

#include <QTabBar>
#include <QWebEngineView>

class WebViewTabBar : public QTabBar
{
    Q_OBJECT

public:
    WebViewTabBar(QWidget *parent = 0);
    ~WebViewTabBar();

    int addTab(QWebEngineProfile *profile, const QUrl &url);
    void setProfile(QWebEngineProfile *profile);

    QWebEngineView *currentView();

signals:
    void currentTabChanged(QWebEngineView *view);

private slots:
    void handleCurrentChanged(int index);
    void handleTabClose(int index);

    void updateTabText(QWebEngineView *view, const QString &text);

private:
    QVector<QWebEngineView*> m_views;
};

#endif // WEBVIEWTABBAR_H