QWidgetless
self.setWindowFlags(Qt.CustomizeWindowHint | Qt.FramelessWindowHint | Qt.Dialog) 去掉窗口的標題
self.resize(200,300)從新設置
setWindowIcon(QIcon(「res/ico/icon.ico」))設置程序窗口圖標
.hide()ide
setShortcut(_translate("MainWindow", "Ctrl+O", None))工具
ToolBarget
self.homeAct = QAction(QIcon("res/ico/home.ico"), "&首頁", self, triggered=self.homePage)
self.toolbar = self.addToolBar('Home') 增長工具欄
self.toolbar.addAction(self.homeAct) 增長Actionio
MenuBar程序
self.addAvatarAct = QAction(QIcon("res/ico/addAvatar.ico"), "&Add Avatar", self, triggered=self.addAvatar)#增長Action
self.addMenu = self.menuBar().addMenu("&添加")#增長菜單欄
self.addMenu.addAction(self.addAvatarAct)#在菜單欄增長Action數據
StatusBarco
self.statusBar().showMessage("數據加載完成")icon
Layouttar