Guest User

Untitled

a guest
Sep 9th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
  2. import QtQuick 1.1
  3. import com.nokia.meego 1.1
  4. import QtWebKit 1.0
  5. import "Constants.js" as Constants
  6. Page {
  7. id: descriptionPage
  8. property alias html: webView.html
  9. property alias title: webView.title
  10. property alias icon: webView.icon
  11. property alias progress: webView.progress
  12. property alias url: webView.url
  13. property alias back: webView.back
  14. property alias stop: webView.stop
  15. property alias reload: webView.reload
  16. property alias forward: webView.forward
  17. tools: ToolBarLayout {
  18. ToolIcon {
  19. iconSource: "image://theme/icon-m-toolbar-back"
  20. onClicked: {
  21. // itemDescriptionPage.enabled = false
  22. pageStack.pop()
  23. }
  24. }
  25. }
  26. Flickable {
  27. id: flickable
  28. anchors.fill: parent
  29. contentWidth: Math.max(parent.width,webView.width)
  30. contentHeight: Math.max(parent.height,webView.height)
  31. // PinchArea {
  32. // pinch.target: webView
  33. // pinch.minimumScale: 1.0
  34. // pinch.maximumScale: 3.0
  35.  
  36. // onPinchFinished: {
  37.  
  38. // flickable.contentHeight = 854 * pinch.scale
  39. // flickable.contentWidth = 400 * pinch.scale
  40. // flickable.contentX = 0
  41. // flickable.contentY = 0
  42. //// webView.contentsScale = pinch. scale
  43. // console.log("pinch scale: " + pinch.scale)
  44. //// flickable.contentX = 0
  45. //// flickable.contentY = 0
  46. // }
  47. // onPinchUpdated: {
  48. //// webView.scale = scale
  49. //// console.log("pinch scale: " + scale)
  50. // }
  51.  
  52. WebView {
  53. id: webView
  54. smooth: true
  55. contentsScale: 1
  56. transformOrigin: Item.Center
  57. settings.localContentCanAccessRemoteUrls: false
  58. settings.fantasyFontFamily: "Arial"
  59. settings.fixedFontFamily: "Monospace"
  60. settings.minimumFontSize: 15
  61. preferredWidth: flickable.width
  62. preferredHeight: flickable.height
  63. html: ""
  64. onAlert: {
  65. console.log(message);
  66. }
  67. onContentsSizeChanged: {
  68. contentsScale = Math.min(1,flickable.width / contentsSize.width)
  69. }
  70. onHtmlChanged: {
  71. console.log("WebView html changed")
  72. }
  73. }
  74. // }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment