High CPU Usage and Unresponsiveness in QtWebEngineProcess after a Few page reloads
-
QT5.15.2 arm64 os,
The page shows correctly when the app startups , and no reponse after a few page reloads. The same issue after click the "Change Text" button. the QtWebEngineProcess occupies 2 cores and has 200% cpu load.C++ code:
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
QVBoxLayout *layout = new QVBoxLayout(this);
webEngineView = new QWebEngineView(this);
QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, true);
webEngineView->setUrl(QUrl("file:///root/workspace/index.html"));
webEngineView->show();
layout->addWidget(webEngineView);
setLayout(layout);html code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Web Page</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #333;
}
p {
font-size: 16px;
line-height: 1.5;
}
a {
color: #007BFF;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
img {
max-width: 100%;
height: auto;
border: 1px solid #ddd;
border-radius: 4px;
padding: 5px;
}
</style>
</head>
<body>
<h1>Welcome to My Simple Web Page</h1>
<p>This is a simple web page created to demonstrate basic HTML elements.</p>
<p>You can include links, images, and other elements to make your web page more interactive.</p><h2>Links</h2> <p>Here are some useful links:</p> <ul> <li><a href="https://www.example.com" target="_blank">Example.com</a></li> <li><a href="https://www.google.com" target="_blank">Google</a></li> <li><a href="https://www.github.com" target="_blank">GitHub</a></li> </ul> <h2>Images</h2> <p>Here is an example image:</p> <img src="https://via.placeholder.com/300" alt="Placeholder Image"> <h2>JavaScript Example</h2> <p>Click the button below to change the text:</p> <button onclick="changeText()">Change Text</button> <p id="demo">This text will change when you click the button.</p> <script> function changeText() { document.getElementById("demo").innerHTML = "Text has been changed!"; } </script>
</body>
</html>