def __init__(self, layers): format = QGLFormat() format.setVersion(3, 2) format.setProfile(QGLFormat.CoreProfile) QGLFormat.setDefaultFormat(format) super(SphairaView, self).__init__() self.old_pos = QtCore.QPoint(0, 0) self.setMouseTracking(True) self.setFocusPolicy(QtCore.Qt.StrongFocus) self.layers = layers self.zoom = 0.9