From 072f5f615ba5cefbe7f842e985457e9cb7cc7125 Mon Sep 17 00:00:00 2001 From: Irony <892768447@qq.com> Date: Sun, 19 Jan 2020 14:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QWebEngineView/ScreenShotPage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/QWebEngineView/ScreenShotPage.py b/QWebEngineView/ScreenShotPage.py index 56b5f04..ad82821 100644 --- a/QWebEngineView/ScreenShotPage.py +++ b/QWebEngineView/ScreenShotPage.py @@ -35,6 +35,7 @@ html2canvas(el[0], { windowWidth: el.outerWidth(true), }).then(function(canvas) { window._self.saveImage(canvas.toDataURL()); + canvas = null; }); """ @@ -96,7 +97,7 @@ class Window(QWidget): settings.setAttribute(QWebEngineSettings.ScreenCaptureEnabled, True) self.webView.loadStarted.connect(self.onLoadStarted) self.webView.loadFinished.connect(self.onLoadFinished) - self.webView.load(QUrl("https://pyqt5.com")) + self.webView.load(QUrl("https://pyqt.site")) def onLoadStarted(self): print('load started')