screenshot ok
This commit is contained in:
parent
97833345a8
commit
e6321920ec
1 changed files with 5 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ from PySide6.QtGui import QAction
|
||||||
|
|
||||||
from PySide6.QtWebEngineWidgets import QWebEngineView
|
from PySide6.QtWebEngineWidgets import QWebEngineView
|
||||||
from PySide6.QtWebEngineCore import QWebEngineContextMenuRequest
|
from PySide6.QtWebEngineCore import QWebEngineContextMenuRequest
|
||||||
from PySide6.QtCore import QUrl, Qt
|
from PySide6.QtCore import QUrl, Qt, QIODevice, QByteArray, QBuffer
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
|
@ -96,9 +96,11 @@ class BrowserWindow(QMainWindow):
|
||||||
return
|
return
|
||||||
|
|
||||||
def handle_pixmap(pix):
|
def handle_pixmap(pix):
|
||||||
buffer = io.BytesIO()
|
byte_array = QByteArray()
|
||||||
|
buffer = QBuffer(byte_array)
|
||||||
|
buffer.open(QIODevice.OpenModeFlag.WriteOnly)
|
||||||
pix.save(buffer, "PNG")
|
pix.save(buffer, "PNG")
|
||||||
png_data = buffer.getvalue()
|
png_data = byte_array.data()
|
||||||
if self.current_page_id:
|
if self.current_page_id:
|
||||||
screenshot_id = save_screenshot(self.current_page_id, png_data)
|
screenshot_id = save_screenshot(self.current_page_id, png_data)
|
||||||
self.prompt_tag(screenshot_id)
|
self.prompt_tag(screenshot_id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue