webView
[mdictionary] / src / mdictionary / qml / TranslationView.qml
1 import Qt 4.7
2 import QtWebKit 1.0
3
4 Rectangle {
5     id: webBrowser
6     width: 500
7     height: 500
8
9     SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
10     color: myPalette.window
11
12     function setUrl(string){
13         webView.url = "file:///home/test.html";
14         webView.url = string;
15     }
16
17     FlickableWebView {
18         id: webView
19         width:parent.width
20         height:parent.height
21         anchors { top: headerSpace.bottom; left: parent.left; right: parent.right; bottom: parent.bottom }
22     }
23
24     Item { id: headerSpace; width: parent.width; height: 1}
25
26     ScrollBar {
27         scrollArea: webView; width: 8
28         anchors { right: parent.right; top: parent.bottom; bottom: parent.bottom }
29     }
30
31     ScrollBar {
32         scrollArea: webView; height: 8; orientation: Qt.Horizontal
33         anchors { right: parent.right; rightMargin: 8; left: parent.left; bottom: parent.bottom }
34     }
35
36     Button {
37         id: button1
38         textInButton: "+"
39         width: 20;
40         height: 20;
41         anchors.right: parent.right
42         anchors.bottom: button2.top
43         onClicked: webView.doZoom(1.05);
44     }
45
46     Button {
47         id: button2
48         textInButton: "-"
49         width: 20;
50         height: 20;
51         anchors.right: parent.right
52         anchors.bottom: parent.bottom
53         onClicked: webView.doZoom(.95);
54     }
55 }