def __init__(self, document, cmdInf, parent): super(IDocument, self).__init__(parent) IDocument.sequenceNumber += 1 self.__document = document self.__document.handledErrorEvent += self._errorEvent self.__cmdInf = cmdInf self.__cadwindow = parent self.setWindowTitle(document.dbPath + '[*]') self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.isUntitled = True # layer list self.__layer_dock = LayerDock(self, self.__document) self._scene = CadScene(document, parent=self) self.__cmdInf.commandLine.evaluatePressed += self.scene.textInput self.__view = CadView(self._scene, self) # the graphics view is the main/central component innerWindows = QtGui.QMainWindow() innerWindows.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.__layer_dock) innerWindows.setCentralWidget(self.__view) self.setWidget(innerWindows) #Inizialize scene self._scene.initDocumentEvents() self._scene.populateScene(document) self._scene.zoomWindows += self.__view.zoomWindows self._scene.fireCommandlineFocus += self.__cmdInf.commandLine.setFocus self._scene.fireKeyShortcut += self.keyShortcut self._scene.fireKeyEvent += self.keyEvent self._scene.fireWarning += self.popUpWarning self._scene.fireCoords += self.setStatusbarCoords