add focus in qml
[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/jakub/test.html";
14         webView.url = string;
15     }
16
17     FlickableWebView {
18         id: webView
19         width:parent.width
20         height:parent.height
21         url:"file:///home/jakub/test.html";
22         anchors { top: headerSpace.bottom; left: parent.left; right: parent.right; bottom: parent.bottom }
23     }
24
25     Item { id: headerSpace; width: parent.width; height: 1}
26
27     ScrollBar {
28         scrollArea: webView;
29         width: 8
30         anchors { right: parent.right; top: parent.bottom; bottom: parent.bottom }
31     }
32
33     ScrollBar {
34         scrollArea: webView;
35         height: 8; orientation: Qt.Horizontal
36         anchors { right: parent.right; rightMargin: 8; left: parent.left; bottom: parent.bottom }
37     }
38
39     Button {
40         id: button1
41         textInButton: "+"
42         width: 20;
43         height: 20;
44         anchors.right: parent.right
45         anchors.bottom: button2.top
46         onClicked: webView.doZoom(1.05);
47     }
48
49     Button {
50         id: button2
51         textInButton: "-"
52         width: 20;
53         height: 20;
54         anchors.right: parent.right
55         anchors.bottom: parent.bottom
56         onClicked: webView.doZoom(.95);
57     }
58 }