We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe728b6 commit ff8ef13Copy full SHA for ff8ef13
Chapter11/invoice_maker_printable.py
@@ -259,8 +259,14 @@ def _print_document(self):
259
self.preview.document().print(self.printer)
260
261
def print_dialog(self):
262
- self._print_document()
+ # Errata: the book contained this line:
263
+ #self._print_document()
264
+ # As noted by DevinLand in issue #8, this can cause the document to start printing.
265
dialog = qtps.QPrintDialog(self.printer, self)
266
+
267
+ # Instead we'll add this line, so _print_document is triggered when the dialog is
268
+ # accepted:
269
+ dialog.accepted.connect(self._print_document)
270
dialog.exec()
271
self._update_preview_size()
272
0 commit comments