I'm encountering an issue while trying to integrate a QWebEngineView into a user interface. The problem arises when I add the QWebEngineView dynamically to the UI: the UI briefly closes and then immediately reopens. I would expect the UI to remain unaffected by the addition of the QWebEngineView. I've tested this behavior with both PySide6 and PyQt6, and in both cases, the issue persists. However, interestingly, when using PyQt5, the problem does not occur.
Here's a minimal reproducible example:
import sys
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtWebEngineWidgets import QWebEngineView
app = QApplication(sys.argv)
window = QMainWindow()
window.show()
window.setCentralWidget(QWebEngineView(window))
app.exec()
I also found a discussion about a similar issue here, but the provided solution didn't resolve the problem for me.
Any insights or suggestions on how to prevent the UI from closing and reopening when dynamically adding a QWebEngineView would be greatly appreciated. Thank you!