BrowserView.h raw
 1#pragma once
 2
 3#include <functional>
 4
 5#include <QWebEngineView>
 6
 7// Specialized view to handle "open in new tab" requests
 8class BrowserView : public QWebEngineView {
 9	Q_OBJECT
10public:
11	explicit BrowserView(QWidget *parent = nullptr);
12
13	// Callback used when the engine wants to create a new window/tab
14	std::function<QWebEngineView *()> createTabCallback;
15
16protected:
17	QWebEngineView *createWindow(QWebEnginePage::WebWindowType type) override;
18};