diff options
-rw-r--r-- | src/webview.cpp | 19 | ||||
-rw-r--r-- | src/webview.h | 3 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 36f62bfa..e39ff32e 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -62,16 +62,16 @@ WebView::WebView(QWidget* parent) : KWebView(parent, false) - , m_page( new WebPage(this) ) - , m_mousePos(QPoint(0,0)) + , m_mousePos( QPoint(0,0) ) { - setPage(m_page); + WebPage *page = new WebPage(this); + setPage(page); // download system connect(this, SIGNAL(linkShiftClicked(const KUrl &)), - m_page, SLOT(downloadUrl(const KUrl &))); - connect(m_page, SIGNAL(downloadRequested(const QNetworkRequest &)), - m_page, SLOT(downloadRequest(const QNetworkRequest &))); + page, SLOT(downloadUrl(const KUrl &))); + connect(page, SIGNAL(downloadRequested(const QNetworkRequest &)), + page, SLOT(downloadRequest(const QNetworkRequest &))); // middle click || ctrl + click signal connect(this, SIGNAL(linkMiddleOrCtrlClicked(const KUrl &)), @@ -89,6 +89,13 @@ WebView::~WebView() } +WebPage *WebView::page() +{ + WebPage *page = qobject_cast<WebPage *>( KWebView::page() ); + return page; +} + + void WebView::contextMenuEvent(QContextMenuEvent *event) { QWebHitTestResult result = page()->mainFrame()->hitTestContent(event->pos()); diff --git a/src/webview.h b/src/webview.h index 1598b19c..6d75c549 100644 --- a/src/webview.h +++ b/src/webview.h @@ -46,7 +46,7 @@ public: explicit WebView(QWidget *parent); ~WebView(); - WebPage *page() { return m_page; } + WebPage *page(); QPoint mousePos(); protected: @@ -71,7 +71,6 @@ signals: void loadUrl(const KUrl &, const Rekonq::OpenType &); private: - WebPage *const m_page; QPoint m_mousePos; }; |