Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qmlvisual / webview / flickable / flickweb.qml
1 import QtQuick 1.0
2 import QtWebKit 1.0
3
4 Flickable {
5     id: flickable
6     width: 320
7     height:  200
8     contentWidth: Math.max(flickable.width,webView.width)
9     contentHeight: Math.max(flickable.height,webView.height)
10     pressDelay: 100
11
12     WebView {
13         id: webView
14         transformOrigin: Item.TopLeft
15         smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
16         url:  "test.html"
17         preferredWidth: flickable.width
18         preferredHeight: flickable.height
19         contentsScale: 1
20         onContentsSizeChanged: {
21             // zoom out
22             contentsScale = Math.min(1,flickable.width / contentsSize.width)
23         }
24     }
25
26     Rectangle {
27         id: button
28         width: 50; height: 50; color: "red"
29         MouseArea {
30             anchors.fill: parent
31             onPressed: button.color = "blue"
32             onReleased: button.color = "green"
33         }
34     }
35 }