If you read here : Bug Report on QWebEngine, you'll see that :
The only opportunity to inject CSS code into the WebEngineView is
using JavaScript. It would be nice to have an appropriate API for this
and it could look like our already existing UserScripts API.
It seems pretty clear : you can't use the WebSettings anymore to insert CSS. Instead, you will have to use HTML/JavaScript to do that.
I don't know if it will help you, but here is an extract of what I have done .
In my .cpp
:
m_pView = new QWebEngineView(this);
QUrl startURL = QUrl("path/to/index.html");
m_pView->setUrl(startURL);
And in the index.html
:
<html>
<head>
<title>TITLE</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Many JS scripts here -->
<link href="./css/style.css" rel="stylesheet">
</head>
<body ng-app="myApp" >
<div ui-view class="page"></div>
</body>
</html>
Hope that helps.