aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/webviewtabbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/webviewtabbar.h')
-rw-r--r--src/widgets/webviewtabbar.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/widgets/webviewtabbar.h b/src/widgets/webviewtabbar.h
new file mode 100644
index 0000000..28a9a18
--- /dev/null
+++ b/src/widgets/webviewtabbar.h
@@ -0,0 +1,31 @@
+#ifndef WEBVIEWTABBAR_H
+#define WEBVIEWTABBAR_H
+
+#include <QTabBar>
+#include <QWebEngineView>
+
+class WebViewTabBar : public QTabBar
+{
+ Q_OBJECT
+
+public:
+ WebViewTabBar(QWidget *parent = 0);
+ ~WebViewTabBar();
+
+ int addTab(QWebEngineView *view);
+ 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