class DetailReportWindow(Main): def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = Ui_DetailReportWindow() self.ui.setupUi(self) self.ui.actionPrint.triggered.connect(self.sendtoprinter) def sendtoprinter(self): dialog = QtGui.QPrintDialog() if dialog.exec_() == QtGui.QDialog.Accepted: self.ui.textEdit.document().print_(dialog.printer())
def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = Ui_DetailReportWindow() self.ui.setupUi(self) self.ui.actionPrint.triggered.connect(self.sendtoprinter)