summaryrefslogtreecommitdiff
path: root/src/descriptionpage.h
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2017-10-23 16:09:27 -0500
committerJeremy Rimpo <jeremy.rimpo@servermonkey.com>2017-10-23 16:10:11 -0500
commitac3953030df11f8c9356fa8998c795608f3180e0 (patch)
tree3db9d7da69c94657e32db96fc82e20321749f198 /src/descriptionpage.h
parentfe44deb765775107da3e4fbd52d5e04574753566 (diff)
Fix the nexus description link handler
Diffstat (limited to 'src/descriptionpage.h')
-rw-r--r--src/descriptionpage.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/descriptionpage.h b/src/descriptionpage.h
new file mode 100644
index 00000000..f6158ee0
--- /dev/null
+++ b/src/descriptionpage.h
@@ -0,0 +1,28 @@
+#include <QWebEnginePage>
+
+#ifndef DESCRIPTIONPAGE_H
+#define DESCRIPTIONPAGE_H
+
+class DescriptionPage : public QWebEnginePage
+{
+ Q_OBJECT
+
+public:
+ DescriptionPage(QObject* parent = 0) : QWebEnginePage(parent){}
+
+ bool acceptNavigationRequest(const QUrl & url, QWebEnginePage::NavigationType type, bool isMainFrame)
+ {
+ if (type == QWebEnginePage::NavigationTypeLinkClicked)
+ {
+ emit linkClicked(url);
+ return false;
+ }
+ return true;
+ }
+
+signals:
+ void linkClicked(const QUrl&);
+
+};
+
+#endif //DESCRIPTIONPAGE_H