當前位置: 首頁>>代碼示例>>Python>>正文


Python QtGui.QPrintDialog類代碼示例

本文整理匯總了Python中PyQt4.QtGui.QPrintDialog的典型用法代碼示例。如果您正苦於以下問題:Python QPrintDialog類的具體用法?Python QPrintDialog怎麽用?Python QPrintDialog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了QPrintDialog類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: showDialog

    def showDialog(self, parent):
        dialog = QPrintDialog(self.printer, parent)
        if dialog.exec_() != QPrintDialog.Accepted:
            return False

        self._init_painter()
        return True
開發者ID:maximerobin,項目名稱:Ufwi,代碼行數:7,代碼來源:printer.py

示例2: _print_report

 def _print_report(self):
     printer = QPrinter()
     print_dialog = QPrintDialog(printer, self)
     print_dialog.setWindowTitle("Print report")
     if print_dialog.exec_() != QDialog.Accepted:
         return
     self.report_view.print_(printer)
開發者ID:karoema,項目名稱:orange3,代碼行數:7,代碼來源:owreport.py

示例3: printNote

 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)
開發者ID:kissthink,項目名稱:mikidown,代碼行數:7,代碼來源:mikiwindow.py

示例4: printFile

    def printFile(self): # Needs some work...
        printDialog = QPrintDialog(self.printer, py_de)
        if printDialog.exec_() == QDialog.Accepted:
            margin = 10
            pageNum = 1
            yPos = 0
            printJob = QPainter()
            printJob.begin(self.printer)
            printJob.setFont(self.font)
            fm = printJob.fontMetrics()

            for i in range(self.textEdit.lines()):
                if margin + yPos > self.printer.height() - margin:
                    pageNum += 1
                    self.printer.newPage()
                    yPos = 0
                printJob.drawText(margin,               # X
                                  margin + yPos,        # Y
                                  self.printer.width(), # Width
                                  self.printer.height(),# Height
                                  QtCore.Qt.AlignTop,       # Alignment
                                  self.textEdit.text(i - 1)# The text to print
                                  )
                yPos += fm.lineSpacing()
            printJob.end
開發者ID:burnchar,項目名稱:py-de,代碼行數:25,代碼來源:py-de.py

示例5: printDocument

 def printDocument(self):
     dialog = QPrintDialog()
     if not dialog.exec_():
         return
     self.printer = dialog.printer()    
     self.imprimir(self.printer)
     self.document.load(self.editmodel)
開發者ID:joseanm,項目名稱:pyqt_billing,代碼行數:7,代碼來源:factura.py

示例6: printContents

 def printContents(self, printer=None):
     if not printer:
         printer = QPrinter()
     dialog = QPrintDialog(printer, self)
     dialog.setWindowTitle(QCoreApplication.translate("QPyShell", "Print Document"))
     if dialog.exec_() != QDialog.Accepted:
         return
     self.outputBrowser.document().print_(printer)
開發者ID:BackupTheBerlios,項目名稱:simuvis4-svn,代碼行數:8,代碼來源:QPyShell.py

示例7: printWindow

 def printWindow(self, printer=None):
     if not printer:
         printer = QPrinter()
     dialog = QPrintDialog(printer, self)
     dialog.setWindowTitle(QCoreApplication.translate('LogWindow', 'Print Document'))
     if dialog.exec_() != QDialog.Accepted:
         return
     self.logView.TextArea.document().print_(printer)
開發者ID:BackupTheBerlios,項目名稱:simuvis4-svn,代碼行數:8,代碼來源:LogWin.py

示例8: _onShortcutPrint

 def _onShortcutPrint(self):
     """Ctrl+P handler.
     Show dialog, print file
     """
     dialog = QPrintDialog(self)
     if dialog.exec_() == QDialog.Accepted:
         printer = dialog.printer()
         self.print_(printer)
開發者ID:kcrossen,項目名稱:qutepart,代碼行數:8,代碼來源:__init__.py

示例9: print_

 def print_(self):
     dialog = QPrintDialog(self.printer)
     if dialog.exec_():
         painter = QPainter(self.printer)
         painter.setRenderHint(QPainter.Antialiasing)
         painter.setRenderHint(QPainter.TextAntialiasing)
         self.scene.clearSelection()
         #self.removeBorders()
         self.scene.render(painter)
開發者ID:pyros2097,項目名稱:SabelIDE,代碼行數:9,代碼來源:level.py

示例10: _print

 def _print(self):
     dialog = QPrintDialog(self)
     if dialog.exec_() != QPrintDialog.Accepted:
         return
     printer = dialog.printer()
     currentView = self.mainView.currentWidget()
     viewPrinter = ViewPrinter(printer, currentView)
     currentView.fitViewsForPrint(viewPrinter)
     viewPrinter.render()
開發者ID:Mouchnino,項目名稱:moneyguru,代碼行數:9,代碼來源:main_window.py

示例11: canvas_print

def canvas_print(self_):
    self_.scene.clearSelection()
    self_.m_export_printer = QPrinter()
    dialog = QPrintDialog(self_.m_export_printer, self_)

    if dialog.exec_():
        painter = QPainter(self_.m_export_printer)
        painter.setRenderHint(QPainter.Antialiasing)
        painter.setRenderHint(QPainter.TextAntialiasing)
        self_.scene.render(painter)
開發者ID:kayosiii,項目名稱:Cadence,代碼行數:10,代碼來源:shared_canvas.py

示例12: slot_canvasPrint

    def slot_canvasPrint(self):
        self.scene.clearSelection()
        self.fExportPrinter = QPrinter()
        dialog = QPrintDialog(self.fExportPrinter, self)

        if dialog.exec_():
            painter = QPainter(self.fExportPrinter)
            painter.setRenderHint(QPainter.Antialiasing)
            painter.setRenderHint(QPainter.TextAntialiasing)
            self.scene.render(painter)
開發者ID:rhetr,項目名稱:Cadence,代碼行數:10,代碼來源:shared_canvasjack.py

示例13: printWindow

 def printWindow(self, printer=None):
     if not printer:
         printer = QPrinter()
     printer.setFullPage(True)
     printer.setPageSize(QPrinter.A4)
     dialog = QPrintDialog(printer, self)
     dialog.setWindowTitle(QCoreApplication.translate('QwtPlot', 'Print Document'))
     if dialog.exec_() != QDialog.Accepted:
         return
     self.plot.print_(printer, QwtPlotPrintFilter())
開發者ID:BackupTheBerlios,項目名稱:simuvis4-svn,代碼行數:10,代碼來源:QwtPlotWindow.py

示例14: printc

def printc(tedit,titulo="Reporte",orientacion=0,margen=[5,10,5,10,0]):
  printer=QtGui.QPrinter(QPrinter.HighResolution)
  printer.setOrientation(orientacion)
  printer.setPaperSize(QtGui.QPrinter.Letter)
  printer.setPageMargins(*margen)
  printer.setOutputFormat(QPrinter.PdfFormat)
  printer.setOutputFileName(titulo)
  prev=QPrintDialog(printer)
  if prev.exec_()==QDialog.Accepted:
      tedit.print_(printer)
開發者ID:dravix,項目名稱:pyventa,代碼行數:10,代碼來源:libutil.py

示例15: print_webpage

 def print_webpage(self):
     """
     Callback for the print action.  Should show a print dialog and print the webpage to the printer.
     """
     printer = QPrinter()
     print_dialog = QPrintDialog(printer, self)
     print_dialog.setWindowTitle("Print Page")
     if print_dialog.exec_() == QDialog.Accepted:
         self.print_(printer)
     else:
         return False
開發者ID:totalretribution,項目名稱:wcgbrowser,代碼行數:11,代碼來源:browser.py


注:本文中的PyQt4.QtGui.QPrintDialog類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。