aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/webview.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-12-20 12:53:40 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-12-20 12:53:40 +0100
commit3323b83af3bc0cd4feff0e0463718e77d4eabef7 (patch)
treebea0abe418c808f8f089a642e098c993b29af143 /src/webengine/webview.h
parentChanged license from GPL3+ to GPL3 (diff)
downloadsmolbote-3323b83af3bc0cd4feff0e0463718e77d4eabef7.tar.xz
Can now open links in new tab
Diffstat (limited to 'src/webengine/webview.h')
-rw-r--r--src/webengine/webview.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/webengine/webview.h b/src/webengine/webview.h
index 10654fa..d30a1fd 100644
--- a/src/webengine/webview.h
+++ b/src/webengine/webview.h
@@ -12,11 +12,12 @@
#include <QWebEngineView>
#include <QMenu>
+class MainWindow;
class WebView : public QWebEngineView
{
Q_OBJECT
public:
- explicit WebView(QWidget *parent = nullptr);
+ explicit WebView(MainWindow *parentMainWindow, QWidget *parent = nullptr);
~WebView();
QMenu *pageMenu();
@@ -24,13 +25,16 @@ public:
void setPage(QWebEnginePage *page);
signals:
- void linkHovered(const QString &url);
void newBookmark(const QString &title, const QUrl &url);
+protected:
+ WebView *createWindow(QWebEnginePage::WebWindowType type);
+
private slots:
void handleLinkHovered(const QString &url);
private:
+ MainWindow *m_parent = nullptr;
QMenu *m_pageMenu = nullptr;
};