def run(self): app = QApplication(sys.argv) w = QMainWindow() w.resize(700, 700) w.move(400, 0) w.setWindowTitle('Simple') w.show() w.isDrawMode = self.isDrawMode w.fileMenu = w.menuBar().addMenu("&File") w.fileSaveMenuItem = SfAction("&Save", w, shortcut="CTRL+S", tip="Save current scenario") w.fileSaveMenuItem.triggered.connect(self.fileSave) w.fileMenu.addAction(w.fileSaveMenuItem) w.fileMenu.addAction(SfAction("&Quit", w, slot=self.fileQuit(), shortcut="ALT+F4", tip="Quit SimFrames")) w.toolbar = w.addToolBar("Activities Toolbar") w.toolbar.setObjectName("ActivitiesToolbar") playActionsGroup = QActionGroup(w) w.toolbar.addAction(SfAction("&Play", w, "play.png", self.play, "CTRL+P", "Start the project", True, actionGroup=playActionsGroup )) w.toolbar.addAction(SfAction("&Stop", w, "stop.png", self.stop, "CTRL+F", "Stop executing", True, actionGroup=playActionsGroup, checked=True )) w.toolbar.addAction(SfSeparator(w)) self.mouseModeGroup = QActionGroup(w) w.toolbar.addAction(SfAction("&Move", self.mouseModeGroup, "moveMode.png", shortcut="CTRL+M", tip="Turn on mode to move components around canvas", checkable=True, checked=True)) self.drawAction = SfAction("&Draw", self.mouseModeGroup, "connectMode.png", shortcut="CTRL+D", tip="Turn on mode to connect components in canvas", checkable=True) w.toolbar.addAction(self.drawAction) w.toolbar.addAction(SfSeparator(w)) w.accordion = SfAccordion() functions = SfAccordionSection("Functions") functions.addComponents([SfComponent("add.png",), SfComponent("minus.png"), SfComponent("multiplication.png")]) inputSection = SfAccordionSection("Input") inputSection.addComponents([SfComponent("scale.png", ), SfComponent("square.png"), SfComponent("constant.png" )]) outputSection = SfAccordionSection("Output") outputSection.addComponents([SfComponent("txt.png", ), SfComponent("graph.png", )]) w.accordion.addSections([functions, inputSection, outputSection]) scene = SfGraphicsScene(w) self.canvas = SfGraphicsView(scene) scene.sceneRectChanged.connect(self.canvas.updateSceneRect) centralWidget = QWidget() mainLayout = QBoxLayout(QBoxLayout.LeftToRight, centralWidget) mainLayout.addWidget(w.accordion) mainLayout.addWidget(self.canvas) centralWidget.setLayout(mainLayout) w.setCentralWidget(centralWidget) w.quitAction = SfAction("&Quit", w, slot=self.fileQuit(), shortcut="ALT+F4", tip="Quit SimFrames") app.exec_()