summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-05-10 10:45:27 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-05-13 15:57:22 (GMT)
commit3c1cb52aae6f7a5bd94c28a0b183e2375526724b (patch)
tree444168fc9292afe8a2d288ee9659745347ae6c21 /demos
parentb3cf8db56491642443f4eea86a12e3d0eb869217 (diff)
downloadQt-3c1cb52aae6f7a5bd94c28a0b183e2375526724b.zip
Qt-3c1cb52aae6f7a5bd94c28a0b183e2375526724b.tar.gz
Qt-3c1cb52aae6f7a5bd94c28a0b183e2375526724b.tar.bz2
Removed dependency of QDeclarativeWebView to private Qt (Declarative) API
Exchanged the use of QDeclarativePaintedItem with the use of QGraphicsWebView and its tiled backing store.
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/webbrowser/content/FlickableWebView.qml29
1 files changed, 7 insertions, 22 deletions
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml
index 7efbaa3..32d69d8 100644
--- a/demos/declarative/webbrowser/content/FlickableWebView.qml
+++ b/demos/declarative/webbrowser/content/FlickableWebView.qml
@@ -12,8 +12,8 @@ Flickable {
id: flickable
width: parent.width
- contentWidth: Math.max(parent.width,webView.width*webView.scale)
- contentHeight: Math.max(parent.height,webView.height*webView.scale)
+ contentWidth: Math.max(parent.width,webView.width)
+ contentHeight: Math.max(parent.height,webView.height)
anchors.top: headerSpace.bottom
anchors.bottom: parent.top
anchors.left: parent.left
@@ -28,7 +28,6 @@ Flickable {
WebView {
id: webView
- pixelCacheSize: 4000000
transformOrigin: Item.TopLeft
function fixUrl(url)
@@ -48,8 +47,6 @@ Flickable {
url: fixUrl(webBrowser.urlString)
smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
- smoothCache: true // We do want smooth rendering
- fillColor: "white"
focus: true
zoomFactor: 1
@@ -59,14 +56,13 @@ Flickable {
{
if (centerX) {
var sc = zoom/contentsScale;
- scaleAnim.to = sc;
+ scaleAnim.to = zoom;
flickVX.from = flickable.contentX
flickVX.to = Math.max(0,Math.min(centerX-flickable.width/2,webView.width*sc-flickable.width))
finalX.value = flickVX.to
flickVY.from = flickable.contentY
flickVY.to = Math.max(0,Math.min(centerY-flickable.height/2,webView.height*sc-flickable.height))
finalY.value = flickVY.to
- finalZoom.value = zoom
quickZoom.start()
}
}
@@ -74,8 +70,8 @@ Flickable {
Keys.onLeftPressed: webView.contentsScale -= 0.1
Keys.onRightPressed: webView.contentsScale += 0.1
- preferredWidth: flickable.width*zoomFactor
- preferredHeight: flickable.height*zoomFactor
+ preferredWidth: flickable.width
+ preferredHeight: flickable.height
contentsScale: 1/zoomFactor
onContentsSizeChanged: {
// zoom out
@@ -108,9 +104,8 @@ Flickable {
NumberAnimation {
id: scaleAnim
target: webView
- property: "scale"
- from: 1
- to: 0 // set before calling
+ property: "contentsScale"
+ // the to property is set before calling
easing.type: Easing.Linear
duration: 200
}
@@ -133,16 +128,6 @@ Flickable {
to: 0 // set before calling
}
}
- PropertyAction {
- id: finalZoom
- target: webView
- property: "contentsScale"
- }
- PropertyAction {
- target: webView
- property: "scale"
- value: 1.0
- }
// Have to set the contentXY, since the above 2
// size changes may have started a correction if
// contentsScale < 1.0.