diff options
-rw-r--r-- | src/webview.cpp | 8 | ||||
-rw-r--r-- | src/webview.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 2083cef3..e874411d 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -66,6 +66,7 @@ WebView::WebView(QWidget* parent) , _scrollTimer( new QTimer(this) ) , _VScrollSpeed(0) , _HScrollSpeed(0) + , _disableAutoScroll(false) { WebPage *page = new WebPage(this); setPage(page); @@ -320,6 +321,9 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) void WebView::mousePressEvent(QMouseEvent *event) { + QWebHitTestResult result = page()->mainFrame()->hitTestContent( event->pos() ); + _disableAutoScroll = result.isContentEditable(); + switch(event->button()) { case Qt::XButton1: @@ -426,9 +430,7 @@ void WebView::keyPressEvent(QKeyEvent *event) } } - QWebHitTestResult result = page()->mainFrame()->hitTestContent( mapFromGlobal( QCursor::pos() ) ); - - if( result.isContentEditable() ) + if(_disableAutoScroll) { KWebView::keyPressEvent(event); return; diff --git a/src/webview.h b/src/webview.h index 85ebf46a..0fe83ae4 100644 --- a/src/webview.h +++ b/src/webview.h @@ -79,6 +79,7 @@ private: QTimer *_scrollTimer; int _VScrollSpeed; int _HScrollSpeed; + bool _disableAutoScroll; }; #endif |