Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0, 5.0.1
-
None
-
Qt 5.0.1
-
If54453081debee7ad9f8c003b1bd54c5b0927fc9
Description
I'm sorry if this does not belong here, but I'm still confused where QtQuick WebView issues should be reported. I've first reported it on the Webkit tracker, but it looks like it is being ignored there. So maybe this is the right place.
https://bugs.webkit.org/show_bug.cgi?id=108337
-------------
In QtQuick 2.0 WebView is derived from Flickable. Therefore I expect the Flickable API to work with WebView.
However, if I change the contentY or contentX properties the content scrolls correctly out of view, but the now visible content is not painted. If I flick the content a couple of pixels, then the content suddenly gets painted correctly.
Also, if I change contentY or contentX and then using the mouse wheel or the cursor keys for scrolling, the content jumps back to the original position before contentY or contentX was changed.
Because of this behavior it is not possible to implement scroll bars in QML.
Tested with Qt 5.0.0 official binaries and Qt 5.0.1 binaries on Linux (64 bit) and Windows 8 (32 bit).
Attached is a screenshot showing what happens after scrolling down by using the contentY property.
Also here is an example to reproduce the problem:
import QtQuick 2.0 import QtWebKit 3.0 Rectangle { width: 900 height: 600 color: "white" WebView { id: web url: "http://heise.de" anchors.fill: parent anchors.rightMargin: 20 } Rectangle { color: "lightgray" width: 20 anchors.right: parent.right anchors.top: parent.top anchors.bottom: parent.bottom Rectangle { id: handle color: (mouse.pressed || mouse.containsMouse) ? "lightblue" : "darkgray" width: parent.width height: web.visibleArea.heightRatio * web.height y: web.visibleArea.yPosition * web.height MouseArea { id: mouse hoverEnabled: true drag.target: parent drag.axis: Drag.YAxis drag.minimumY: 0 drag.maximumY: web.height - handle.height anchors.fill: parent onPositionChanged: { if (pressedButtons == Qt.LeftButton) { web.contentY = handle.y * web.contentHeight / web.height } } } } } }