本文整理匯總了Python中PyQt4.QtGui.QPrintDialog.exec方法的典型用法代碼示例。如果您正苦於以下問題:Python QPrintDialog.exec方法的具體用法?Python QPrintDialog.exec怎麽用?Python QPrintDialog.exec使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui.QPrintDialog
的用法示例。
在下文中一共展示了QPrintDialog.exec方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: printBill
# 需要導入模塊: from PyQt4.QtGui import QPrintDialog [as 別名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec [as 別名]
def printBill(self):
self.saveTab() #save before printing so that changes will be added to print
html = self.creator.makePrintfile(self.item)
document = QWebView()
document.setHtml(html)
printer = QPrinter()
printer.setOutputFileName(getBillPath() + str(datetime.datetime.now())[0:-7] + '_' + str(self.item.id) + '.pdf')
printpreview = QPrintDialog(printer, self)
printpreview.exec()
document.print(printer)
示例2: printNote
# 需要導入模塊: from PyQt4.QtGui import QPrintDialog [as 別名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec [as 別名]
def printNote(self):
printer = QPrinter(QPrinter.HighResolution)
printer.setCreator(__appname__ + ' ' + __version__)
printer.setDocName(self.notesTree.currentItem().text(0))
printdialog = QPrintDialog(printer, self)
if printdialog.exec() == QDialog.Accepted:
self.notesView.print_(printer)