Revert to using a Label for Entry Rendering :(

This commit is contained in:
Tobias Fella 2020-06-03 17:39:56 +02:00
parent ca4a4de2e6
commit 17b4e39eb2
4 changed files with 13 additions and 16 deletions

View File

@ -18,7 +18,7 @@ include(KDEClangFormat)
include(KDECMakeSettings) include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE) 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) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Syndication Config I18n)
if (ANDROID) if (ANDROID)
@ -26,7 +26,7 @@ if (ANDROID)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2)
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
else() else()
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets WebEngine) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
endif() endif()
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING) add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)

View File

@ -13,7 +13,7 @@ set(alligator_SRCS
kconfig_add_kcfg_files(alligator_SRCS alligatorsettings.kcfgc GENERATE_MOC) kconfig_add_kcfg_files(alligator_SRCS alligatorsettings.kcfgc GENERATE_MOC)
add_executable(alligator ${alligator_SRCS}) 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) if(ANDROID)
target_link_libraries(alligator PRIVATE target_link_libraries(alligator PRIVATE
@ -35,7 +35,7 @@ if(ANDROID)
globe globe
) )
else() else()
target_link_libraries(alligator PRIVATE Qt5::Widgets Qt5::WebEngine) target_link_libraries(alligator PRIVATE Qt5::Widgets)
endif() endif()
install(TARGETS alligator ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS alligator ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})

View File

@ -25,7 +25,6 @@
#endif #endif
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QtWebView>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QQmlContext> #include <QQmlContext>
#include <QQuickView> #include <QQuickView>
@ -45,7 +44,6 @@ Q_DECL_EXPORT
#endif #endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QtWebView::initialize();
#ifdef Q_OS_ANDROID #ifdef Q_OS_ANDROID
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
#else #else

View File

@ -21,27 +21,26 @@
import QtQuick 2.14 import QtQuick 2.14
import QtQuick.Controls 2.14 as Controls import QtQuick.Controls 2.14 as Controls
import QtQuick.Layouts 1.14 import QtQuick.Layouts 1.14
import QtWebView 1.14
import org.kde.kirigami 2.12 as Kirigami import org.kde.kirigami 2.12 as Kirigami
import org.kde.alligator 1.0 import org.kde.alligator 1.0
Kirigami.Page { Kirigami.ScrollablePage {
id: page id: page
property QtObject entry property QtObject entry
property var content: "<style> img { max-width: 100%; } body { background: " + Kirigami.Theme.backgroundColor + "; font-family: " + Kirigami.Theme.defaultFont.family + "; } </style><body>" + page.entry.content + "</body>";
title: entry.title title: entry.title
WebView { Controls.Label {
id: webView //anchors.fill: parent
anchors.fill: parent text: page.entry.content
Component.onCompleted: { baseUrl: page.entry.baseUrl
loadHtml(page.content, page.entry.baseUrl) textFormat: Text.RichText
} wrapMode: Text.WordWrap
Layout.fillWidth: true
onLinkActivated: Qt.openUrlExternally(link)
} }
} }