Details
Description
Using Qt3D alongside with QtWebEngine in the same application leads to rendering artifacts/crashes on systems with Intel Graphics Cards. As you can see in the attachments, the NVIDIA GPU renders everything as wanted. With the Intel GPU the application renders artifacts (it's flickering) and at some time it crashes.
NVIDIA: INTEL:
We thought the problem of setting a second defaultSurfaceFormat during the Qt3DWindow construction led to the problem (see QTBUG-60614). But we already compiled a modified version for ourselves which doesn't work either.
Furthermore we tried setting different application attributes like AA_ShareOpenGLContexts, AA_UseSoftwareGL etc. but all options didn't solve the problem.
Disabling the intel graphics card and using the NVIDIA instead does not lead to the said issues. But we need a solution for all kinds of GPU.
If you want to reproduce the problem very fast, you can use the qt3d/basicshapes-cpp project in the QtExamples and adjust the code the following way:
main.cpp:
... #include <QtWebEngineWidgets/QWebEngineView> //<- include headers ... int main(int argc, char **argv) { QApplication app(argc, argv); Qt3DExtras::Qt3DWindow *view = new Qt3DExtras::Qt3DWindow(); ... QWebEngineView* webview = new QWebEngineView(); //<- create QWebEngineView webview->setUrl(QUrl("https://qt.io")); //<- set URL QWidget *widget = new QWidget; QHBoxLayout *hLayout = new QHBoxLayout(widget); QVBoxLayout *vLayout = new QVBoxLayout(); vLayout->setAlignment(Qt::AlignTop); hLayout->addWidget(container, 1); hLayout->addWidget(webview, 1); //<- add webview to hLayout hLayout->addLayout(vLayout); ... }
basicshapes-cpp.pro: (add webenginewidgets to pro file)
... QT += 3dcore 3drender 3dinput 3dextras webenginewidgets ...
Related: QTBUG-60614