diff options
Diffstat (limited to 'src/webview.cpp')
-rw-r--r-- | src/webview.cpp | 19 |
1 files changed, 13 insertions, 6 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()); |