diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-11-23 03:44:39 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-11-23 03:44:39 (GMT) |
commit | 52068f57f9c32098a90cc217730a530f85590f65 (patch) | |
tree | 1ad54491b7bf37b019b1cdf8405be8037c9c213c /tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml | |
parent | 83ececf2e036bd5bf8100808aed8ce469f13f593 (diff) | |
download | Qt-52068f57f9c32098a90cc217730a530f85590f65.zip Qt-52068f57f9c32098a90cc217730a530f85590f65.tar.gz Qt-52068f57f9c32098a90cc217730a530f85590f65.tar.bz2 |
Ensure WebView press delay timer is cancelled when grab is taken.
Flickable steals the grab, but the timer was not stopped and the
keepGrab flag is set and the mouse grabbed. This means that the WebView
now has the grab and subsequent clicks on another element are ignored.
Task-number: QTBUG-15529
Reviewed-by: Joona Petrell
Diffstat (limited to 'tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml')
-rw-r--r-- | tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml new file mode 100644 index 0000000..6063226 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml @@ -0,0 +1,35 @@ +import QtQuick 1.0
+import QtWebKit 1.0
+
+Flickable {
+ id: flickable
+ width: 320
+ height: 200
+ contentWidth: Math.max(flickable.width,webView.width)
+ contentHeight: Math.max(flickable.height,webView.height)
+ pressDelay: 100
+
+ WebView {
+ id: webView
+ transformOrigin: Item.TopLeft
+ smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
+ url: "test.html"
+ preferredWidth: flickable.width
+ preferredHeight: flickable.height
+ contentsScale: 1
+ onContentsSizeChanged: {
+ // zoom out
+ contentsScale = Math.min(1,flickable.width / contentsSize.width)
+ }
+ }
+
+ Rectangle {
+ id: button
+ width: 50; height: 50; color: "red"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: button.color = "blue"
+ onReleased: button.color = "green"
+ }
+ }
+}
|