Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
- import QtQuick 1.1
- import com.nokia.meego 1.1
- import QtWebKit 1.0
- import "Constants.js" as Constants
- Page {
- id: descriptionPage
- property alias html: webView.html
- property alias title: webView.title
- property alias icon: webView.icon
- property alias progress: webView.progress
- property alias url: webView.url
- property alias back: webView.back
- property alias stop: webView.stop
- property alias reload: webView.reload
- property alias forward: webView.forward
- tools: ToolBarLayout {
- ToolIcon {
- iconSource: "image://theme/icon-m-toolbar-back"
- onClicked: {
- // itemDescriptionPage.enabled = false
- pageStack.pop()
- }
- }
- }
- Flickable {
- id: flickable
- anchors.fill: parent
- contentWidth: Math.max(parent.width,webView.width)
- contentHeight: Math.max(parent.height,webView.height)
- // PinchArea {
- // pinch.target: webView
- // pinch.minimumScale: 1.0
- // pinch.maximumScale: 3.0
- // onPinchFinished: {
- // flickable.contentHeight = 854 * pinch.scale
- // flickable.contentWidth = 400 * pinch.scale
- // flickable.contentX = 0
- // flickable.contentY = 0
- //// webView.contentsScale = pinch. scale
- // console.log("pinch scale: " + pinch.scale)
- //// flickable.contentX = 0
- //// flickable.contentY = 0
- // }
- // onPinchUpdated: {
- //// webView.scale = scale
- //// console.log("pinch scale: " + scale)
- // }
- WebView {
- id: webView
- smooth: true
- contentsScale: 1
- transformOrigin: Item.Center
- settings.localContentCanAccessRemoteUrls: false
- settings.fantasyFontFamily: "Arial"
- settings.fixedFontFamily: "Monospace"
- settings.minimumFontSize: 15
- preferredWidth: flickable.width
- preferredHeight: flickable.height
- html: ""
- onAlert: {
- console.log(message);
- }
- onContentsSizeChanged: {
- contentsScale = Math.min(1,flickable.width / contentsSize.width)
- }
- onHtmlChanged: {
- console.log("WebView html changed")
- }
- }
- // }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment