-1
我寫了這段代碼。我需要一個將我的標誌放在第一行中間的功能。以及如何添加邊框到我的頁面?由pyqt4打印徽標和頁面邊框的位置
QtCore.QObject.connect(self.pushButton_5,QtCore.SIGNAL(_fromUtf8("clicked()")),self.Delete)
def Delete(self):
self.printer = QtGui.QPrinter()
self.printer.setPageSize(self.printer.A4)
self.text = QtGui.QTextEdit()
self.cursor = QtGui.QTextCursor()
self.cursor = self.text.textCursor()
self.image = QtGui.QTextImageFormat()
self.image.setName("leaf.jpg")
self.cursor.insertImage(self.image)
pdialog = QtGui.QPrintPreviewDialog(self.printer)
pdialog.paintRequested.connect(self.text.print_)
pdialog.exec_()