Closing QWebEngineView warns “Release of profile requested but WebEnginePage still not deleted. Expect troubles !”

The problem is that python’s way of working with memory does not comply with the pre-established rules by Qt (that’s the bindings problems), that is, Qt wants QWebEnginePage to be removed first but python removes QWebEngineProfile first.

In your case, I don’t see the need to create a QWebEnginePage or a QWebEngineProfile different from the one that comes by default, but to obtain the QWebEngineProfile by default:

class PlotlyViewer(QtWebEngineWidgets.QWebEngineView):
    def __init__(self, fig=None):
        super().__init__()
        self.page().profile().downloadRequested.connect(self.on_downloadRequested)

        # https://stackoverflow.com/a/8577226/3620725
        self.temp_file = tempfile.NamedTemporaryFile(
            mode="w", suffix=".html", delete=False
        )
        self.set_figure(fig)

        self.resize(700, 600)
        self.setWindowTitle("Plotly Viewer")

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top