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