Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def printer(self):
- "Prints the current diagram"
- # Create the printer
- printerobject = QtGui.QPrinter(0)
- # Set the settings
- printdialog = QtGui.QPrintDialog(printerobject)
- if printdialog.exec_() == QtGui.QDialog.Accepted:
- # Print
- pixmapImage = QtGui.QPixmap.grabWidget(self.contentswidget)
- painter = QtGui.QPainter(printerobject)
- painter.drawPixmap(0, 0, pixmapImage)
- def printer(self):
- "Prints the current diagram"
- # Create the printer
- printerobject = QtGui.QPrinter(0)
- # Set the settings
- printdialog = QtGui.QPrintDialog(printerobject)
- if printdialog.exec_() == QtGui.QDialog.Accepted:
- # Print
- pixmapImage = QtGui.QPixmap.grabWidget(self.contentswidget)
- painter = QtGui.QPainter(printerobject)
- painter.drawPixmap(0, 0, pixmapImage)
- del painter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement