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


Python QPrinter.setCreator方法代码示例

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


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

示例1: printNote

# 需要导入模块: from PyQt4.QtGui import QPrinter [as 别名]
# 或者: from PyQt4.QtGui.QPrinter import setCreator [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)
开发者ID:kissthink,项目名称:mikidown,代码行数:9,代码来源:mikiwindow.py

示例2: __outPDF

# 需要导入模块: from PyQt4.QtGui import QPrinter [as 别名]
# 或者: from PyQt4.QtGui.QPrinter import setCreator [as 别名]
 def __outPDF(self):
     """
     To save the profile as pdf file
     """
     fileName = QFileDialog.getSaveFileName(
         self.__iface.mainWindow(), QCoreApplication.translate("VDLTools", "Save As"),
         QCoreApplication.translate("VDLTools", "Profile.pdf"),"Portable Document Format (*.pdf)")
     if fileName is not None:
         if self.__lib == 'Qwt5':
             printer = QPrinter()
             printer.setCreator(QCoreApplication.translate("VDLTools", "QGIS Profile Plugin"))
             printer.setOutputFileName(fileName)
             printer.setOutputFormat(QPrinter.PdfFormat)
             printer.setOrientation(QPrinter.Landscape)
             self.__plotWdg.print_(printer)
         elif self.__lib == 'Matplotlib':
             self.__plotWdg.figure.savefig(str(fileName))
开发者ID:gusthiot,项目名称:VDLTools,代码行数:19,代码来源:profile_dock_widget.py

示例3: saveWindow

# 需要导入模块: from PyQt4.QtGui import QPrinter [as 别名]
# 或者: from PyQt4.QtGui.QPrinter import setCreator [as 别名]
 def saveWindow(self):
     fileTypes = {'PDF':('pdf',), 'Postscript':('ps',),'SVG':('svg',)}
     filters = ';;'.join(['%s (%s)' % (k, ' '.join(['*.'+e for e in v])) for k, v in fileTypes.items()])
     dlg = QFileDialog(self,
         QCoreApplication.translate('QwtPlot', 'Select type and name of file to save'),
         SimuVis4.Globals.defaultFolder or '', filters)
     dlg.setFileMode(QFileDialog.AnyFile)
     dlg.setAcceptMode(QFileDialog.AcceptSave)
     if dlg.exec_() != QDialog.Accepted:
         return
     tmp = str(dlg.selectedFilter())
     fileType = tmp[:tmp.find('(')-1]
     dlg.setDefaultSuffix(fileTypes[fileType][0])
     files = dlg.selectedFiles()
     if not files:
         return
     fileName = unicode(files[0])
     SimuVis4.Globals.defaultFolder, tmp = os.path.split(fileName)
     if fileType == 'PDF':
         printer = QPrinter()
         printer.setOutputFormat(QPrinter.PdfFormat)
         printer.setOrientation(QPrinter.Landscape)
         printer.setOutputFileName(fileName)
         printer.setCreator('SimuVis4')
         self.plot.print_(printer)
     elif fileType == 'Postscript':
         printer = QPrinter()
         printer.setOutputFormat(QPrinter.PostScriptFormat)
         printer.setOrientation(QPrinter.Landscape)
         printer.setOutputFileName(fileName)
         printer.setCreator('SimuVis4')
         self.plot.print_(printer)
     elif fileType == 'SVG':
         generator = QSvgGenerator()
         generator.setFileName(fileName)
         generator.setSize(QSize(800, 600))
         self.plot.print_(generator)
开发者ID:BackupTheBerlios,项目名称:simuvis4-svn,代码行数:39,代码来源:QwtPlotWindow.py


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