diff options
Diffstat (limited to 'MatrixWebView.cpp')
-rw-r--r-- | MatrixWebView.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/MatrixWebView.cpp b/MatrixWebView.cpp index 8126d65..48459b7 100644 --- a/MatrixWebView.cpp +++ b/MatrixWebView.cpp | |||
@@ -37,6 +37,9 @@ | |||
37 | * | 37 | * |
38 | */ | 38 | */ |
39 | 39 | ||
40 | #include <QtWidgets> | ||
41 | #include <QtNetwork> | ||
42 | #include <QtWebKitWidgets> | ||
40 | #include "MatrixWebView.h" | 43 | #include "MatrixWebView.h" |
41 | #include <sys/types.h> | 44 | #include <sys/types.h> |
42 | #include <sys/socket.h> | 45 | #include <sys/socket.h> |
@@ -45,12 +48,15 @@ | |||
45 | 48 | ||
46 | int MatrixWebView::sigtermFd[2]; | 49 | int MatrixWebView::sigtermFd[2]; |
47 | 50 | ||
48 | MatrixWebView::MatrixWebView(QWidget* parent) | 51 | MatrixWebView::MatrixWebView(const QUrl& url) |
49 | : QWebView(parent) | ||
50 | { | 52 | { |
51 | if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermFd)) | 53 | if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermFd)) |
52 | qFatal("Couldn't create TERM socketpair"); | 54 | qFatal("Couldn't create TERM socketpair"); |
53 | 55 | ||
56 | view = new QWebView(this); | ||
57 | view->load(url); | ||
58 | setCentralWidget(view); | ||
59 | |||
54 | snTerm = new QSocketNotifier(sigtermFd[1], QSocketNotifier::Read, this); | 60 | snTerm = new QSocketNotifier(sigtermFd[1], QSocketNotifier::Read, this); |
55 | connect(snTerm, SIGNAL(activated(int)), this, SLOT(handleSigTerm())); | 61 | connect(snTerm, SIGNAL(activated(int)), this, SLOT(handleSigTerm())); |
56 | } | 62 | } |