From 969efc9bddcc1b21d1c70f301d8cb0d44904c9c5 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 6 Apr 2010 01:20:04 +0200 Subject: I confused mouse cursor with the key one :) Here is another hack to fix bug 211557 DISCLAIMER: this, as the previous, is an hack NOT a solution BUG: 211557 --- src/webview.cpp | 8 +++++--- 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 -- cgit v1.2.1