当前位置: 首页>>代码示例>>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;未经允许,请勿转载。