diff options
author | Sandro Knauß <sknauss@kde.org> | 2016-10-19 14:28:08 +0200 |
---|---|---|
committer | Sandro Knauß <sknauss@kde.org> | 2016-10-19 14:28:08 +0200 |
commit | 6833c46a9522be3c55cefe79676293a0a571cbf5 (patch) | |
tree | 6a91b7e00cff34aec70341c24921fd9a1dd095ea /components/mailviewer/qml/HtmlContent.qml | |
parent | be38c2ebaa77b116028cbe34f777e3d8e5cbc776 (diff) | |
download | kube-6833c46a9522be3c55cefe79676293a0a571cbf5.tar.gz kube-6833c46a9522be3c55cefe79676293a0a571cbf5.zip |
use treemodel in qml
Diffstat (limited to 'components/mailviewer/qml/HtmlContent.qml')
-rw-r--r-- | components/mailviewer/qml/HtmlContent.qml | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/components/mailviewer/qml/HtmlContent.qml b/components/mailviewer/qml/HtmlContent.qml new file mode 100644 index 00000000..15bd1915 --- /dev/null +++ b/components/mailviewer/qml/HtmlContent.qml | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License along | ||
15 | with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | import QtQuick.Controls 1.3 | ||
21 | import QtWebKit 3.0 | ||
22 | // import QtWebEngine 1.3 //This would give use contentsSize | ||
23 | import QtWebEngine 1.2 | ||
24 | |||
25 | Item { | ||
26 | id: root | ||
27 | property string content: model.content | ||
28 | property int contentHeight: helperView.contentHeight; | ||
29 | //FIXME workaround until QtWebEngine 1.3 with contentsSize | ||
30 | |||
31 | height: contentHeight | ||
32 | width: partColumn.width | ||
33 | |||
34 | WebView { | ||
35 | id: helperView | ||
36 | visible: false | ||
37 | Component.onCompleted: loadHtml(content, "file:///") | ||
38 | } | ||
39 | WebEngineView { | ||
40 | id: htmlView | ||
41 | anchors.fill: parent | ||
42 | Component.onCompleted: loadHtml(content, "file:///") | ||
43 | } | ||
44 | onContentChanged: { | ||
45 | htmlView.loadHtml(content, "file:///"); | ||
46 | helperView.loadHtml(content, "file:///"); | ||
47 | } | ||
48 | } | ||