我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用PySide.QtGui.QStatusBar()。
def setupUi(self, MainWindow): """Setting up UI for Main Window """ MainWindow.setObjectName("MainWindow") MainWindow.resize(804, 600) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName("horizontalLayout") self.txtInput = QtGui.QPlainTextEdit(self.centralwidget) self.txtInput.setObjectName("MarkDtextEdit") self.horizontalLayout.addWidget(self.txtInput) self.txtOutput = QtGui.QTextEdit(self.centralwidget) self.txtOutput.setObjectName("MarkDownView") self.horizontalLayout.addWidget(self.txtOutput) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 804, 21)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, QueryEditorWindow): QueryEditorWindow.setObjectName("QueryEditorWindow") QueryEditorWindow.resize(746, 642) self.centralwidget = QtGui.QWidget(QueryEditorWindow) self.centralwidget.setObjectName("centralwidget") self.verticalLayout_2 = QtGui.QVBoxLayout(self.centralwidget) self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.tableView = QtGui.QTableView(self.centralwidget) self.tableView.setObjectName("tableView") self.verticalLayout.addWidget(self.tableView) self.verticalLayout_2.addLayout(self.verticalLayout) QueryEditorWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(QueryEditorWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 746, 21)) self.menubar.setObjectName("menubar") self.menuActions = QtGui.QMenu(self.menubar) self.menuActions.setObjectName("menuActions") QueryEditorWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(QueryEditorWindow) self.statusbar.setObjectName("statusbar") QueryEditorWindow.setStatusBar(self.statusbar) self.toolBar = QtGui.QToolBar(QueryEditorWindow) self.toolBar.setObjectName("toolBar") QueryEditorWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) self.actionCommit = QtGui.QAction(QueryEditorWindow) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/standard_icons/save.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.actionCommit.setIcon(icon) self.actionCommit.setObjectName("actionCommit") self.actionUndo = QtGui.QAction(QueryEditorWindow) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/standard_icons/undo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionUndo.setIcon(icon1) self.actionUndo.setObjectName("actionUndo") self.actionCriteria = QtGui.QAction(QueryEditorWindow) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(":/standard_icons/filter.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionCriteria.setIcon(icon2) self.actionCriteria.setObjectName("actionCriteria") self.actionRefresh = QtGui.QAction(QueryEditorWindow) icon3 = QtGui.QIcon() icon3.addPixmap(QtGui.QPixmap(":/standard_icons/refresh.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.actionRefresh.setIcon(icon3) self.actionRefresh.setObjectName("actionRefresh") self.menuActions.addAction(self.actionCommit) self.menuActions.addAction(self.actionUndo) self.menuActions.addAction(self.actionCriteria) self.menuActions.addAction(self.actionRefresh) self.menubar.addAction(self.menuActions.menuAction()) self.toolBar.addAction(self.actionCommit) self.toolBar.addAction(self.actionUndo) self.toolBar.addAction(self.actionRefresh) self.toolBar.addAction(self.actionCriteria) self.retranslateUi(QueryEditorWindow) QtCore.QMetaObject.connectSlotsByName(QueryEditorWindow)