From 17b4e39eb2dbd0a8e969c62bf86e806ba74f591a Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Wed, 3 Jun 2020 17:39:56 +0200 Subject: [PATCH] Revert to using a Label for Entry Rendering :( --- CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 4 ++-- src/main.cpp | 2 -- src/qml/EntryPage.qml | 19 +++++++++---------- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3b1b956..dcc4b578 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(KDEClangFormat) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) -find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Sql WebView) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Sql) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Syndication Config I18n) if (ANDROID) @@ -26,7 +26,7 @@ if (ANDROID) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2) find_package(OpenSSL REQUIRED) else() - find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets WebEngine) + find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets) endif() add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 13666fb4..1e81ee48 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,7 @@ set(alligator_SRCS kconfig_add_kcfg_files(alligator_SRCS alligatorsettings.kcfgc GENERATE_MOC) add_executable(alligator ${alligator_SRCS}) -target_link_libraries(alligator PRIVATE Qt5::Core Qt5::Qml Qt5::Quick Qt5::Sql Qt5::WebView KF5::Syndication KF5::CoreAddons KF5::ConfigGui KF5::I18n) +target_link_libraries(alligator PRIVATE Qt5::Core Qt5::Qml Qt5::Quick Qt5::Sql KF5::Syndication KF5::CoreAddons KF5::ConfigGui KF5::I18n) if(ANDROID) target_link_libraries(alligator PRIVATE @@ -35,7 +35,7 @@ if(ANDROID) globe ) else() - target_link_libraries(alligator PRIVATE Qt5::Widgets Qt5::WebEngine) + target_link_libraries(alligator PRIVATE Qt5::Widgets) endif() install(TARGETS alligator ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/src/main.cpp b/src/main.cpp index 3bd4bd62..a190bdb5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,7 +25,6 @@ #endif #include -#include #include #include #include @@ -45,7 +44,6 @@ Q_DECL_EXPORT #endif int main(int argc, char *argv[]) { - QtWebView::initialize(); #ifdef Q_OS_ANDROID QGuiApplication app(argc, argv); #else diff --git a/src/qml/EntryPage.qml b/src/qml/EntryPage.qml index eca1ce59..2ff047f1 100644 --- a/src/qml/EntryPage.qml +++ b/src/qml/EntryPage.qml @@ -21,27 +21,26 @@ import QtQuick 2.14 import QtQuick.Controls 2.14 as Controls import QtQuick.Layouts 1.14 -import QtWebView 1.14 import org.kde.kirigami 2.12 as Kirigami import org.kde.alligator 1.0 -Kirigami.Page { +Kirigami.ScrollablePage { id: page property QtObject entry - property var content: "" + page.entry.content + ""; - title: entry.title - WebView { - id: webView - anchors.fill: parent - Component.onCompleted: { - loadHtml(page.content, page.entry.baseUrl) - } + Controls.Label { + //anchors.fill: parent + text: page.entry.content + baseUrl: page.entry.baseUrl + textFormat: Text.RichText + wrapMode: Text.WordWrap + Layout.fillWidth: true + onLinkActivated: Qt.openUrlExternally(link) } } \ No newline at end of file