diff options
Diffstat (limited to 'components/package/contents/ui/WebView.qml')
-rw-r--r-- | components/package/contents/ui/WebView.qml | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/components/package/contents/ui/WebView.qml b/components/package/contents/ui/WebView.qml index fd418879..bb6a8df7 100644 --- a/components/package/contents/ui/WebView.qml +++ b/components/package/contents/ui/WebView.qml | |||
@@ -17,21 +17,13 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 |
20 | import QtWebKit 3.0 | 20 | import QtWebEngine 1.3 |
21 | // import QtWebEngine 1.3 //This would give use contentsSize | ||
22 | import QtWebEngine 1.2 | ||
23 | 21 | ||
24 | Item { | 22 | Item { |
25 | id: root | 23 | id: root |
26 | property string content; | 24 | property string content; |
27 | property int contentWidth: helperView.contentWidth; | 25 | property int contentWidth: 0; |
28 | property int contentHeight: helperView.contentHeight; | 26 | property int contentHeight: 0; |
29 | //FIXME workaround until QtWebEngine 1.3 with contentsSize | ||
30 | WebView { | ||
31 | id: helperView | ||
32 | visible: false | ||
33 | Component.onCompleted: loadHtml(content, "file:///") | ||
34 | } | ||
35 | WebEngineView { | 27 | WebEngineView { |
36 | id: htmlView | 28 | id: htmlView |
37 | anchors.fill: parent | 29 | anchors.fill: parent |
@@ -40,9 +32,12 @@ Item { | |||
40 | console.warn("Status is ", loadRequest.status); | 32 | console.warn("Status is ", loadRequest.status); |
41 | } | 33 | } |
42 | Component.onCompleted: loadHtml(content, "file:///") | 34 | Component.onCompleted: loadHtml(content, "file:///") |
35 | onContentsSizeChanged: { | ||
36 | root.contentWidth = contentsSize.width | ||
37 | root.contentHeight = contentsSize.height | ||
38 | } | ||
43 | } | 39 | } |
44 | onContentChanged: { | 40 | onContentChanged: { |
45 | htmlView.loadHtml(content, "file:///"); | 41 | htmlView.loadHtml(content, "file:///"); |
46 | helperView.loadHtml(content, "file:///"); | ||
47 | } | 42 | } |
48 | } | 43 | } |