Delete print dialogs on close
This commit is contained in:
parent
2388874e82
commit
4a0e34fca7
@ -204,6 +204,7 @@ class CommandDispatcher:
|
||||
tab = self._tabs.cntwidget(count)
|
||||
if tab is not None:
|
||||
preview = QPrintPreviewDialog()
|
||||
preview.setAttribute(Qt.WA_DeleteOnClose)
|
||||
preview.paintRequested.connect(tab.print)
|
||||
preview.exec_()
|
||||
|
||||
@ -220,6 +221,7 @@ class CommandDispatcher:
|
||||
tab = self._tabs.cntwidget(count)
|
||||
if tab is not None:
|
||||
printdiag = QPrintDialog()
|
||||
printdiag.setAttribute(Qt.WA_DeleteOnClose)
|
||||
printdiag.open(lambda: tab.print(printdiag.printer()))
|
||||
|
||||
@cmdutils.register(instance='mainwindow.tabs.cmd')
|
||||
|
@ -18,7 +18,8 @@
|
||||
"""The main browser widgets."""
|
||||
|
||||
import sip
|
||||
from PyQt5.QtCore import QCoreApplication, pyqtSignal, pyqtSlot, PYQT_VERSION
|
||||
from PyQt5.QtCore import (QCoreApplication, pyqtSignal, pyqtSlot, PYQT_VERSION,
|
||||
Qt)
|
||||
from PyQt5.QtNetwork import QNetworkReply
|
||||
from PyQt5.QtWidgets import QFileDialog
|
||||
from PyQt5.QtPrintSupport import QPrintDialog
|
||||
@ -149,6 +150,7 @@ class BrowserPage(QWebPage):
|
||||
"please upgrade!")
|
||||
return
|
||||
printdiag = QPrintDialog()
|
||||
printdiag.setAttribute(Qt.WA_DeleteOnClose)
|
||||
printdiag.open(lambda: frame.print(printdiag.printer()))
|
||||
|
||||
@pyqtSlot('QNetworkRequest')
|
||||
|
Loading…
Reference in New Issue
Block a user