summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-10 11:31:29 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-12 14:33:43 +0000
commit1de90f5d25be4a45028290133cbe4743007cb140 (patch)
treea28567e40891f64cebb56e08ef42a5df5d808614
parent78898d5adb833e90e8435c728ec0ff339d2cd5a6 (diff)
Fix webui example
Load the URL after setting the page on the view. This actually works around a real bug we need to look into. Change-Id: I32b2cfd3c940cb48584cc066709327b5dd02c1fb Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io> (cherry picked from commit 0e06ccdafddabb26012f67631b303fa978e9eeee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/webenginewidgets/webui/main.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/webenginewidgets/webui/main.cpp b/examples/webenginewidgets/webui/main.cpp
index 92c1b8e7..4bef7919 100644
--- a/examples/webenginewidgets/webui/main.cpp
+++ b/examples/webenginewidgets/webui/main.cpp
@@ -69,10 +69,9 @@ int main(int argc, char *argv[])
profile.installUrlSchemeHandler(WebUiHandler::schemeName, &handler);
QWebEnginePage page(&profile);
- page.load(WebUiHandler::aboutUrl);
-
QWebEngineView view;
view.setPage(&page);
+ page.load(WebUiHandler::aboutUrl);
view.setContextMenuPolicy(Qt::NoContextMenu);
view.resize(500, 600);
view.show();