def __init__(self): self.app = QApplication(sys.argv) # 图片资源路径 PixmapCache.addSearchPath("res") self.project = Project() self.win = WinMain( self.project )
def createAction(self): self.actionNewProject = QAction(PixmapCache.getIcon(Prefrences.icons['action_new_project']), "新建项目", self) self.actionNewProject.setText("新建项目") self.actionNetworkTest = QAction(PixmapCache.getIcon(Prefrences.icons['action_network_test']), "网络测试", self) self.actionNetworkTest.setText("网络测试") self.actionNewProject.triggered.connect(self.newProject) self.actionNetworkTest.triggered.connect(self.networkTest)
def __init__(self, project): super(QMainWindow, self).__init__() self.setObjectName("WinMain") self.setWindowTitle("最终幻想") self.resize(763, 536) self.setWindowIcon(PixmapCache.getIcon("chest.ico")) self.project = project self.createAction() self.createToolBar() self.createCentralWidget() self.createDockWindow() self.createStatusBar()