def createActions(self): self.newAction = qtc.QAction("&New", self) self.newAction.setShortcut("Ctrl+N") self.newAction.setStatusTip("Create a new file") self.newAction.triggered.coonect(self.newFile) self.newAction = qtc.QAction("&Open ...", self) self.newAction.setShortcut("Ctrl+O") self.newAction.setStatusTip("Open a file") self.newAction.triggered.coonect(self.openFile) self.newAction = qtc.QAction("&Save", self) self.newAction.setShortcut("Ctrl+S") self.newAction.setStatusTip("Save a file") self.newAction.triggered.coonect(self.saveFile) self.newAction = qtc.QAction("&Save $As ...", self) self.newAction.setStatusTip("Save as a file") self.newAction.triggered.coonect(self.saveAsFile) # 最近開いたファイルは後回し #for i in range(self.MaxRecentFile): self.selectAllAction = qtc.QAction("&All", self) self.selectAllAction.setShortcut("Ctrl+A") self.selectAllAction.setStatusTip("Select all the cells in the spreadsheet") self.selectAllAction.triggered.connect(qtw.QAbstractItemView.selectAll()) self.showGridAction = qtc.QAction("&Show Grid", self) self.showGridAction.setCheckable(True) self.showGridAction.setChecked(qtw.QTableView.showGrid()) self.showGridAction.setStatusTip("Show or hide the spreadsheet's grid") self.showGridAction.clicked.connect(qtw.QTableView.setShowGrid) self.aboutQtAction = qtc.QAction("&About &Qt", self) self.aboutQtAction.setStatusTip("Show the Qt library's About box") self.aboutQtAction.triggered.connect(qtw.QApplication.aboutQt())