summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/declarative/webbrowser/content/FlickableWebView.qml6
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview.cpp6
2 files changed, 3 insertions, 9 deletions
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml
index 09a3c04..7c46d4c 100644
--- a/demos/declarative/webbrowser/content/FlickableWebView.qml
+++ b/demos/declarative/webbrowser/content/FlickableWebView.qml
@@ -67,12 +67,12 @@ Flickable {
Keys.onLeftPressed: webView.contentsScale -= 0.1
Keys.onRightPressed: webView.contentsScale += 0.1
- preferredWidth: flickable.width
- preferredHeight: flickable.height
+ preferredWidth: flickable.width*zoomFactor
+ preferredHeight: flickable.height*zoomFactor
contentsScale: 1/zoomFactor
onContentsSizeChanged: {
// zoom out
- contentsScale = flickable.width / contentsSize.width
+ contentsScale = Math.min(0.25,flickable.width / contentsSize.width)
}
onUrlChanged: {
// got to topleft
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
index c9ba37b..35dd1f0 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
@@ -317,8 +317,6 @@ void QmlGraphicsWebView::setUrl(const QUrl &url)
page()->setViewportSize(QSize(
d->preferredwidth>0 ? d->preferredwidth : width(),
d->preferredheight>0 ? d->preferredheight : height()));
- if (d->preferredwidth > 0 && d->preferredheight > 0)
- page()->setPreferredContentsSize(QSize(d->preferredwidth,d->preferredheight));
QUrl seturl = url;
if (seturl.isEmpty())
seturl = QUrl(QLatin1String("about:blank"));
@@ -349,8 +347,6 @@ void QmlGraphicsWebView::setPreferredWidth(int iw)
Q_D(QmlGraphicsWebView);
if (d->preferredwidth == iw) return;
d->preferredwidth = iw;
- if (d->preferredwidth > 0 && d->preferredheight > 0)
- page()->setPreferredContentsSize(QSize(d->preferredwidth,d->preferredheight));
//expandToWebPage();
emit preferredWidthChanged();
}
@@ -370,8 +366,6 @@ void QmlGraphicsWebView::setPreferredHeight(int ih)
Q_D(QmlGraphicsWebView);
if (d->preferredheight == ih) return;
d->preferredheight = ih;
- if (d->preferredwidth > 0 && d->preferredheight > 0)
- page()->setPreferredContentsSize(QSize(d->preferredwidth,d->preferredheight));
emit preferredHeightChanged();
}