summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml
blob: adbd7a5000d7d782e86eaa5ed03a18760cbecee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import Qt 4.6
import org.webkit 1.0

// Note that zooming is better done using zoomFactor and careful
// control of rendering to avoid excessive re-rendering during
// zoom animations. This test is written for simplicity.
WebView {
    width: 200
    height: 250
    Behavior on x { NumberAnimation { } }
    Behavior on y { NumberAnimation { } }
    Behavior on scale { NumberAnimation { } }
    url: "zooming.html"
    preferredWidth: width
    preferredHeight: height
    onDoubleClick: {console.log(clickX,clickY);heuristicZoom(clickX,clickY,2)}
    onZoomTo: {console.log(zoom);scale=zoom;x=width/2-centerX;y=height/2-centerY}
}