summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaloyan Chehlarski <kaloyan.chehlarski@qt.io>2025-11-17 17:08:18 +0100
committerKaloyan Chehlarski <kaloyan.chehlarski@qt.io>2025-11-20 11:53:20 +0100
commit86b5c9cdc00897438a87fd22a38623be47b5144d (patch)
tree805688d458cd637312fc90f2a0819bb1e1daf37d
parenta6a78cf776a2096037fd04bfba9f9be121fe77d6 (diff)
Android: Ensure loadHtml() adds a history entry
This is necessary because subsequent calls to url() will otherwise return about:blank, even when the user has provided a baseUrl argument. Change-Id: I092ebd7f1b8a9b6b92eab184f8b5ae8fc9826fe5 Reviewed-by: Moss Heim <moss.heim@qt.io>
-rw-r--r--src/plugins/android/qandroidwebview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/android/qandroidwebview.cpp b/src/plugins/android/qandroidwebview.cpp
index fd191ad..4a61e5f 100644
--- a/src/plugins/android/qandroidwebview.cpp
+++ b/src/plugins/android/qandroidwebview.cpp
@@ -145,7 +145,8 @@ void QAndroidWebViewPrivate::loadHtml(const QString &html, const QUrl &baseUrl)
// andorid webview in case of non data baseURL scheme will loaded 'html' into the WebView as
// a plain string meaning any url encoded entities in the string will not be decoded.
m_viewController.callMethod<void>("loadDataWithBaseURL", baseUrl.toString(), html,
- mimeTypeString, jstring(nullptr), jstring(nullptr));
+ mimeTypeString, jstring(nullptr),
+ baseUrl.isValid() ? baseUrl.toString() : QString());
}
}