Skip to content

Instantly share code, notes, and snippets.

@estan
Created April 19, 2016 09:26
Show Gist options
  • Select an option

  • Save estan/4ad9a16028be975ee164df7df3b4efc3 to your computer and use it in GitHub Desktop.

Select an option

Save estan/4ad9a16028be975ee164df7df3b4efc3 to your computer and use it in GitHub Desktop.
test.py
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