Created
April 19, 2016 09:26
-
-
Save estan/4ad9a16028be975ee164df7df3b4efc3 to your computer and use it in GitHub Desktop.
test.py
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 | |
| from PyQt4 import QtCore, QtGui | |
| from PyQt4.QtGui import QPixmap | |
| class GraphWidget(QtGui.QGraphicsView): | |
| def __init__(self, mainwindow, *args, **kwargs): | |
| super(GraphWidget, self).__init__(*args, **kwargs) | |
| self.scene = QtGui.QGraphicsScene() | |
| self.setScene(self.scene) | |
| class awindow(QtGui.QMainWindow): | |
| def __init__(self): | |
| super(self.__class__, self).__init__() | |
| self.piccanvas = GraphWidget(self) | |
| self.setCentralWidget(self.piccanvas) | |
| app = None | |
| def main(): | |
| global app | |
| app = QtGui.QApplication(sys.argv) | |
| window = awindow() | |
| window.show() | |
| app.exec_() | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment