本文整理汇总了Python中PyQt5.QtWidgets.QStatusBar.addPermanentWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QStatusBar.addPermanentWidget方法的具体用法?Python QStatusBar.addPermanentWidget怎么用?Python QStatusBar.addPermanentWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QStatusBar
的用法示例。
在下文中一共展示了QStatusBar.addPermanentWidget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ResultWindow
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import addPermanentWidget [as 别名]
#.........这里部分代码省略.........
self.resize(630, 514)
self.centralwidget = QWidget(self)
self.verticalLayout = QVBoxLayout(self.centralwidget)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setSpacing(0)
self.actionsButton = QPushButton(tr("Actions"))
self.detailsButton = QPushButton(tr("Details"))
self.dupesOnlyCheckBox = QCheckBox(tr("Dupes Only"))
self.deltaValuesCheckBox = QCheckBox(tr("Delta Values"))
self.searchEdit = SearchEdit()
self.searchEdit.setMaximumWidth(300)
self.horizontalLayout = horizontalWrap([self.actionsButton, self.detailsButton,
self.dupesOnlyCheckBox, self.deltaValuesCheckBox, None, self.searchEdit, 8])
self.horizontalLayout.setSpacing(8)
self.verticalLayout.addLayout(self.horizontalLayout)
self.resultsView = ResultsView(self.centralwidget)
self.resultsView.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.resultsView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.resultsView.setSortingEnabled(True)
self.resultsView.verticalHeader().setVisible(False)
h = self.resultsView.horizontalHeader()
h.setHighlightSections(False)
h.setSectionsMovable(True)
h.setStretchLastSection(False)
h.setDefaultAlignment(Qt.AlignLeft)
self.verticalLayout.addWidget(self.resultsView)
self.setCentralWidget(self.centralwidget)
self._setupActions()
self._setupMenu()
self.statusbar = QStatusBar(self)
self.statusbar.setSizeGripEnabled(True)
self.setStatusBar(self.statusbar)
self.statusLabel = QLabel(self)
self.statusbar.addPermanentWidget(self.statusLabel, 1)
if self.app.prefs.resultWindowIsMaximized:
self.setWindowState(self.windowState() | Qt.WindowMaximized)
else:
if self.app.prefs.resultWindowRect is not None:
self.setGeometry(self.app.prefs.resultWindowRect)
else:
moveToScreenCenter(self)
#--- Private
def _update_column_actions_status(self):
# Update menu checked state
menu_items = self.app.model.result_table.columns.menu_items()
for action, (display, visible) in zip(self._column_actions, menu_items):
action.setChecked(visible)
#--- Actions
def actionsTriggered(self):
self.actionsButton.showMenu()
def addToIgnoreListTriggered(self):
self.app.model.add_selected_to_ignore_list()
def copyTriggered(self):
self.app.model.copy_or_move_marked(True)
def deleteTriggered(self):
self.app.model.delete_marked()
def deltaTriggered(self, state=None):
# The sender can be either the action or the checkbox, but both have a isChecked() method.
self.resultsModel.delta_values = self.sender().isChecked()
示例2: Form
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import addPermanentWidget [as 别名]
class Form(QMainWindow):
update_form = pyqtSignal()
def __init__(self, parent=None):
super(Form, self).__init__(parent)
self.db_interface = DB_Interface()
self.db_interface.new_tracking_item.connect(self.update_tracking)
fibre_saturation_Label = QLabel("Fiber Saturation Ratio (%) (from tables)")
self.fibre_saturation_spinbox = QDoubleSpinBox()
self.fibre_saturation_spinbox.setDecimals(1)
self.fibre_saturation_spinbox.setRange(0, 100)
self.fibre_saturation_spinbox.setSingleStep(0.1)
self.fibre_saturation_spinbox.setValue(18)
#self.fibre_saturation_spinbox.valueChanged.connect(self.control.update_EMC_fast_target)
temperature_Label = QLabel("Current temperature measurement")
#self.temperature_value_label = QLabel("{0}".format(self.control.temperature))
humidity_Label = QLabel("Current humidity measurement")
#self.humidity_value_label = QLabel("{0}".format(self.control.humidity))
final_saturation_Label = QLabel("Target wood saturation Ratio (%)")
self.final_saturation_spinbox = QDoubleSpinBox()
self.final_saturation_spinbox.setDecimals(1)
self.final_saturation_spinbox.setRange(0, 100)
self.final_saturation_spinbox.setSingleStep(0.1)
self.final_saturation_spinbox.setValue(6)
#self.final_saturation_spinbox.valueChanged.connect(self.control.update_EMC_slow_target)
emc_Label = QLabel("Equilibrium Moisture Content")
#self.emc_value_label = QLabel("{0}".format(self.control.equilibrium_moisture_content))
self.temp_deque_len_label = QLabel()
#self.temp_deque_len_label.setNum(len(self.control.temp_deque1))
self.dummy_label = QLabel()
#self.dummy_label.setNum(self.control.state)
mainLayout = QGridLayout()
mainLayout.addWidget(fibre_saturation_Label, 0 , 0)
mainLayout.addWidget(self.fibre_saturation_spinbox, 1 , 0)
mainLayout.addWidget(temperature_Label, 2 , 0)
#mainLayout.addWidget(self.temperature_value_label, 3 , 0)
mainLayout.addWidget(humidity_Label, 4 , 0)
#mainLayout.addWidget(self.humidity_value_label, 5 , 0)
mainLayout.addWidget(final_saturation_Label, 0 , 1)
mainLayout.addWidget(self.final_saturation_spinbox, 1 , 1)
mainLayout.addWidget(emc_Label, 2 , 1)
#mainLayout.addWidget(self.emc_value_label, 3 , 1)
mainLayout.addWidget(self.temp_deque_len_label, 4 , 1)
mainLayout.addWidget(self.dummy_label, 5 , 1)
self.fire_icon = QPixmap("burn.png")
self.red_icon = QPixmap("circle_red.png")
self.green_icon = QPixmap("circle_green.png")
self.fire_label1 = QLabel()
self.fire_label2 = QLabel()
self.fire_label1.setPixmap(self.fire_icon)
self.fire_label2.setPixmap(self.fire_icon)
self.water_icon = QPixmap("water.png")
self.water_label = QLabel()
self.water_label.setPixmap(self.water_icon)
self.statusBar = QStatusBar()
self.statusBar.addPermanentWidget(self.fire_label1)
self.statusBar.addPermanentWidget(self.fire_label2)
self.statusBar.addPermanentWidget(self.water_label)
#self.statusBar.showMessage("{0} - {1} - {2}".format(self.control.state,self.control.states_list[self.control.state],len(self.control.temp_deque1)))
centralWidget = QWidget()
centralWidget.setLayout(mainLayout)
self.setCentralWidget(centralWidget)
self.setWindowTitle("Humidity Control V1.0")
self.setStatusBar(self.statusBar)
#self.control.compressor.updated.emit()
#self.control.heater.updated.emit()
def update_tracking(self):
# Update tracking view because the tracking data valueChanged
return
'''