Created
December 6, 2013 02:47
-
-
Save chomy/7817816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import PyQt4.QtCore as QtCore | |
| import PyQt4.QtGui as QtGui | |
| class painter(QtGui.QWidget): | |
| def __init__(self, parent=None): | |
| super(painter,self).__init__(parent) | |
| self.resize(400,300) | |
| self.setWindowTitle('QPainter Test') | |
| def paintEvent(self, event): | |
| p = QtGui.QPainter() | |
| p.begin(self) | |
| p.setPen(QtGui.QColor(0, 0, 255)) | |
| p.drawLine(0,0, 100,100) | |
| p.end() | |
| app = QtGui.QApplication(sys.argv) | |
| p = painter() | |
| p.show() | |
| app.exec_() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment