printer=QtGui.QPrinter()
printDialog=QtGui.QPrintDialog(printer)
if (printDialog.exec_() == QtGui.QDialog.Accepted):
painter=QtGui.QPainter()
painter.begin(printer)
painter.setRenderHint(QtGui.QPainter.Antialiasing);
self.mdiArea.activeSubWindow().view.render(painter)
painter.end()
self.statusBar().showMessage("Ready")and it works on win 7 64 bit Hope it will be helpful for you regards, Matteo Il 31/12/2010 18:17, Rodrigo ha scritto:
Hello!I use (Ubuntu 64bit 10.10 + PyQt 2.7 + Python 4.8.2) and QPrintDialog works perfectly. Including the ability to save in PDF. But when tested on Windows Vista 32bits simply nothing appears, not even an error message. The application works perfectly, but when calling the QPrintDialog, nothing ...Already installed to the latest stable version of PyQt 4.8.2 on sight, but still the same behavior. Has been there? Is it necessary for some differentiation in the code that runs on windows? Already searched the internet but did not.Thanks, Rodrigo My code: ------------------------------------------------------------------------ def print(self, string): printDialog = QPrintDialog(self.printer, self) if printDialog.exec_(): filePrint = QTextDocument() filePrint.setDefaultFont(QFont('Liberation Sans',10)) filePrint.setHtml(string) filePrint.print_(self.printer) ------------------------------------------------------------------------ _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt Nessun virus nel messaggio. Controllato da AVG - www.avg.com <http://www.avg.com>Versione: 10.0.1191 / Database dei virus: 1435/3349 - Data di rilascio: 30/12/2010
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
