当前位置: 首页>>代码示例>>Python>>正文


Python QPrintDialog.exec_方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QPrintDialog.exec_方法的典型用法代码示例。如果您正苦于以下问题:Python QPrintDialog.exec_方法的具体用法?Python QPrintDialog.exec_怎么用?Python QPrintDialog.exec_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QPrintDialog的用法示例。


在下文中一共展示了QPrintDialog.exec_方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _print_report

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:9,代码来源:owreport.py

示例2: printFile

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
    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,代码行数:27,代码来源:py-de.py

示例3: printDocument

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:9,代码来源:factura.py

示例4: showDialog

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
    def showDialog(self, parent):
        dialog = QPrintDialog(self.printer, parent)
        if dialog.exec_() != QPrintDialog.Accepted:
            return False

        self._init_painter()
        return True
开发者ID:maximerobin,项目名称:Ufwi,代码行数:9,代码来源:printer.py

示例5: printWindow

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:10,代码来源:LogWin.py

示例6: _onShortcutPrint

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:10,代码来源:__init__.py

示例7: printContents

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:10,代码来源:QPyShell.py

示例8: print_

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:11,代码来源:level.py

示例9: _print

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:11,代码来源:main_window.py

示例10: print_on_paper

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 def print_on_paper(self):
     """Print the document with a printer."""
     
     printer = Qsci.QsciPrinter()
     print_dialog = QPrintDialog(printer)
     print_dialog.setWindowTitle(self.tr("Print Document"))
     print_dialog.addEnabledOption(QPrintDialog.PrintSelection)
     if print_dialog.exec_() == QPrintDialog.Accepted:
         printer.printRange(self)
开发者ID:m4nu3lf,项目名称:PyCSGScriptLive,代码行数:11,代码来源:qpython_edit.py

示例11: printWindow

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
 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,代码行数:12,代码来源:QwtPlotWindow.py

示例12: printc

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
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,代码行数:12,代码来源:libutil.py

示例13: slot_canvasPrint

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
    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,代码行数:12,代码来源:shared_canvasjack.py

示例14: canvas_print

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
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,代码行数:12,代码来源:shared_canvas.py

示例15: print_photo

# 需要导入模块: from PyQt4.QtGui import QPrintDialog [as 别名]
# 或者: from PyQt4.QtGui.QPrintDialog import exec_ [as 别名]
    def print_photo(self):
        print_dialog = QPrintDialog(self._printer,self)

        if print_dialog.exec_() == QDialog.Accepted:
            painter = QPainter(self._printer)
            rect = painter.viewport()
            size = self._lbl_photo.pixmap().size()
            size.scale(rect.size(), Qt.KeepAspectRatio)
            painter.setViewport(rect.x(), rect.y(), size.width(), size.height())
            painter.setWindow(self._lbl_photo.pixmap().rect())
            painter.drawPixmap(0, 0, self._lbl_photo.pixmap())
开发者ID:gltn,项目名称:stdm,代码行数:13,代码来源:document_viewer.py


注:本文中的PyQt4.QtGui.QPrintDialog.exec_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。