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

// 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
    x: Behavior { NumberAnimation { } }
    y: Behavior { NumberAnimation { } }
    scale: Behavior { NumberAnimation { } }
    url: "zooming.html"
    preferredWidth: width
    preferredHeight: height
    onDoubleClick: {print(clickX,clickY);heuristicZoom(clickX,clickY,2)}
    onZoomTo: {print(zoom);scale=zoom;x=width/2-centerX;y=height/2-centerY}
}