本文整理汇总了Python中PyQt5.QtWidgets.QCheckBox方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QCheckBox方法的具体用法?Python QtWidgets.QCheckBox怎么用?Python QtWidgets.QCheckBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QCheckBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def __init__(self, setting_params=None):
super().__init__()
self.setting_params = setting_params
self.search_input = Qw.QLineEdit()
self.table = AngryTableView(self.setting_params['angrysearch_lite'],
self.setting_params['row_height'])
self.upd_button = Qw.QPushButton('update')
self.fts_checkbox = Qw.QCheckBox()
grid = Qw.QGridLayout()
grid.setSpacing(10)
grid.addWidget(self.search_input, 1, 1)
grid.addWidget(self.fts_checkbox, 1, 3)
grid.addWidget(self.upd_button, 1, 4)
grid.addWidget(self.table, 2, 1, 4, 4)
self.setLayout(grid)
self.setTabOrder(self.search_input, self.table)
self.setTabOrder(self.table, self.upd_button)
# THE MAIN APPLICATION WINDOW WITH THE STATUS BAR AND LOGIC
# LOADS AND SAVES QSETTINGS FROM ~/.config/angrysearch
# INITIALIZES AND SETS GUI, WAITING FOR USER INPUTS
示例2: modify_annotation
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def modify_annotation(self):
sender = self.sender()
if isinstance(sender, QtWidgets.QCheckBox):
if not sender.isChecked():
self.update_preview()
return
new_color = None
if sender == self.foregroundColorButton:
new_color = self.get_color(self.foregroundColor)
self.foregroundColor = new_color
if sender == self.highlightColorButton:
new_color = self.get_color(self.highlightColor)
self.highlightColor = new_color
if sender == self.underlineColorButton:
new_color = self.get_color(self.underlineColor)
self.underlineColor = new_color
if new_color:
self.set_button_background_color(sender, new_color)
self.update_preview()
示例3: init_middle_layout
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def init_middle_layout(self):
if not self.should_show:
return
vbox = QtWidgets.QVBoxLayout()
self.select_all = QtWidgets.QCheckBox('Select All ')
self.filter_sub_funcs = QtWidgets.QCheckBox('Filter Out "sub_" functions ')
vbox.addWidget(self.filter_sub_funcs)
vbox.addWidget(self.select_all)
format_str = '{} functions'.format(self.total_functions)
self.function_number = QtWidgets.QLabel(format_str)
self.function_number.setAlignment(Qt.AlignTop)
self.middle_layout.addWidget(self.function_number)
self.middle_layout.addStretch()
self.middle_layout.addLayout(vbox)
示例4: _createIndicatorGroupBox
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def _createIndicatorGroupBox(self):
indicatorGroupBox = QGroupBox('指标')
grid = QGridLayout()
grid.setSpacing(10)
rowNbr = 4
self._indicatorCheckBoxList = []
for i, indicator in enumerate(DyStockDataCommon.dayIndicators):
checkBox = QCheckBox(indicator)
checkBox.setChecked(True)
grid.addWidget(checkBox, i//rowNbr, i%rowNbr)
self._indicatorCheckBoxList.append(checkBox)
indicatorGroupBox.setLayout(grid)
return indicatorGroupBox
示例5: configsettings
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def configsettings(self):
self.line501 = QtWidgets.QTextEdit()
self.gl7.addWidget(self.line501, 0, 0, 1, 3)
msg = '<html>Use this config file, otherwise global config file will be used</html>'
self.checkbox = QtWidgets.QCheckBox("Use This Config File")
self.checkbox.setMinimumHeight(30)
self.checkbox.stateChanged.connect(self.use_config_file)
self.checkbox.setToolTip(msg)
self.gl7.addWidget(self.checkbox, 1, 0, 1, 1)
if ui.use_custom_config_file:
self.checkbox.setChecked(True)
mpvlist = self.basic_params(player='mpv')
mpvstr = '\n'.join(mpvlist)
self.line501.setText(mpvstr)
self.btn_default_settings = QPushButtonExtra('Default Settings')
self.gl7.addWidget(self.btn_default_settings, 1, 1, 1, 1)
self.btn_default_settings.clicked_connect(self.get_default_config_settings)
self.btn_default_settings.setMinimumHeight(30)
self.btn_confirm = QPushButtonExtra('Save Changes')
self.gl7.addWidget(self.btn_confirm, 1, 2, 1, 1)
self.btn_confirm.clicked_connect(self.save_config_settings)
self.btn_confirm.setMinimumHeight(30)
示例6: _layout_widget_preferences_graphics
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def _layout_widget_preferences_graphics(self):
"""
Create graphical options widget.
"""
tab = QtWidgets.QWidget()
tab_layout = QtWidgets.QVBoxLayout(tab)
# full screen mode
checkbox = QtWidgets.QCheckBox('Full screen mode')
self._register_check_box(checkbox, constants.Option.MAINWINDOW_FULLSCREEN)
tab_layout.addWidget(checkbox)
# vertical stretch
tab_layout.addStretch()
# add tab
self.tab_graphics = tab
self.stacked_layout.addWidget(tab)
示例7: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setLayout(QVBoxLayout())
self.layout().setAlignment(Qt.AlignTop)
self.group = QGroupBox(self)
self.group.setLayout(QVBoxLayout(self.group))
self.layout().addWidget(self.group)
self.commandLineEdit = QLineEdit(self.group)
self.group.layout().addWidget(self.commandLineEdit)
self.noOutputCheckBox = QCheckBox(self)
self.layout().addWidget(self.noOutputCheckBox)
self.noErrorCheckBox = QCheckBox(self)
self.layout().addWidget(self.noErrorCheckBox)
self.killCheckBox = QCheckBox(self)
self.layout().addWidget(self.killCheckBox)
self.retranslateUi()
示例8: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def __init__(self, name, parent=None):
title = name+" "+QtWidgets.QApplication.translate("pychemqt", "Axis")
super(AxisWidget, self).__init__(title, parent)
lyt = QtWidgets.QGridLayout(self)
lyt.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "Label")), 1, 1)
self.label = InputFont()
lyt.addWidget(self.label, 1, 2)
self.scale = QtWidgets.QCheckBox(
QtWidgets.QApplication.translate("pychemqt", "Logarithmic scale"))
lyt.addWidget(self.scale, 2, 1, 1, 2)
lyt.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "from")), 3, 1)
self.min = Entrada_con_unidades(float, min=float("-inf"))
lyt.addWidget(self.min, 3, 2)
lyt.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "to")), 4, 1)
self.max = Entrada_con_unidades(float, min=float("-inf"))
lyt.addWidget(self.max, 4, 2)
示例9: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def __init__(self, parent=None):
super().__init__(parent)
self.setupUi(parent)
self.versionLabel.setText(__version__)
self.logLink.setText(f'<a href="file://{LOG_DIR}"><span style="text-decoration:'
'underline; color:#0984e3;">Log</span></a>')
for setting in SettingsModel.select().where(SettingsModel.type == 'checkbox'):
x = filter(lambda s: s['key'] == setting.key, get_misc_settings())
if not list(x): # Skip settings that aren't specified in vorta.models.
continue
b = QCheckBox(translate('settings', setting.label))
b.setCheckState(setting.value)
b.setTristate(False)
b.stateChanged.connect(lambda v, key=setting.key: self.save_setting(key, v))
self.checkboxLayout.addWidget(b)
示例10: createType
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def createType(self, z):
self.Settings = QtWidgets.QGroupBox(globals.trans.string('ZonesDlg', 76))
self.Zone_settings = []
ZoneSettingsLeft = QtWidgets.QFormLayout()
ZoneSettingsRight = QtWidgets.QFormLayout()
settingsNames = globals.trans.stringList('ZonesDlg', 77)
for i in range(0, 8):
self.Zone_settings.append(QtWidgets.QCheckBox())
self.Zone_settings[i].setChecked(z.type & (2 ** i))
if i < 4:
ZoneSettingsLeft.addRow(settingsNames[i], self.Zone_settings[i])
else:
ZoneSettingsRight.addRow(settingsNames[i], self.Zone_settings[i])
ZoneSettingsLayout = QtWidgets.QHBoxLayout()
ZoneSettingsLayout.addLayout(ZoneSettingsLeft)
ZoneSettingsLayout.addStretch()
ZoneSettingsLayout.addLayout(ZoneSettingsRight)
self.Settings.setLayout(ZoneSettingsLayout)
示例11: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def __init__(self, app):
super().__init__(app)
self._widget = QtWidgets.QWidget()
self.layout = QtWidgets.QFormLayout()
self._widget.setLayout(self.layout)
self.input_vswr_limit = QtWidgets.QDoubleSpinBox()
self.input_vswr_limit.setValue(self.vswr_limit_value)
self.input_vswr_limit.setSingleStep(0.1)
self.input_vswr_limit.setMinimum(1)
self.input_vswr_limit.setMaximum(25)
self.input_vswr_limit.setDecimals(2)
self.checkbox_move_marker = QtWidgets.QCheckBox()
self.layout.addRow(QtWidgets.QLabel("<b>Settings</b>"))
self.layout.addRow("VSWR limit", self.input_vswr_limit)
self.layout.addRow(VSWRAnalysis.QHLine())
self.results_label = QtWidgets.QLabel("<b>Results</b>")
self.layout.addRow(self.results_label)
示例12: _get_avoid_options
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def _get_avoid_options(self, avoid_boxes):
"""
Extracts checked boxes in Advanced avoid parameters.
:param avoid_boxes: all checkboxes in advanced paramter dialog.
:type avoid_boxes: list of QCheckBox
:returns: avoid_features parameter
:rtype: JSON dump, i.e. str
"""
avoid_features = []
for box in avoid_boxes:
if box.isChecked():
avoid_features.append((box.text()))
return avoid_features
示例13: set_direction_layout
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def set_direction_layout(self):
box_text = "Direction Reference"
self.direction_box = QtWidgets.QGroupBox(box_text)
load_ref = self.reference is not None and len(self.reference) == 3
Layout = QtWidgets.QGridLayout()
self.check = QtWidgets.QCheckBox('Define Reference Coordinates')
Layout.addWidget(self.check, 0,0,1,3)
self.label_x2 = QtWidgets.QLabel("X:")
Layout.addWidget(self.label_x2,1,1)
self.ref_x = QtWidgets.QDoubleSpinBox()
self.ref_x.setRange(-1000, 1000)
if load_ref: self.ref_x.setValue(self.reference[0])
#self.ref_x.valueChanged.connect(self.update_stimulator)
Layout.addWidget(self.ref_x,2,1)
self.label_y2 = QtWidgets.QLabel("Y:")
Layout.addWidget(self.label_y2,1,2)
self.ref_y = QtWidgets.QDoubleSpinBox()
self.ref_y.setRange(-1000, 1000)
if load_ref: self.ref_y.setValue(self.reference[1])
#self.ref_y.valueChanged.connect(self.update_stimulator)
Layout.addWidget(self.ref_y,2,2)
self.label_z2 = QtWidgets.QLabel("Z:")
Layout.addWidget(self.label_z2,1,3)
self.ref_z = QtWidgets.QDoubleSpinBox()
self.ref_z.setRange(-1000, 1000)
if load_ref: self.ref_z.setValue(self.reference[2])
#self.ref_z.valueChanged.connect(self.update_stimulator)
Layout.addWidget(self.ref_z,2,3)
self.direction_box.setLayout(Layout)
#Returns the positions
示例14: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def __init__(self):
super().__init__()
self.show()
self.run_on_startup_qcb = QtWidgets.QCheckBox(self.tr("Run on startup"))
self._init_ui()
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:7,代码来源:general_settings_wt.py
示例15: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QCheckBox [as 别名]
def __init__(self):
super().__init__()
self.updating_gui_bool = False
self.turn_on_off_qcb = QtWidgets.QCheckBox()
self.turn_on_off_qcb.toggled.connect(self._on_toggled)
on_off_qhl = QtWidgets.QHBoxLayout()
on_off_qhl.setContentsMargins(0,0,0,0)
on_off_qhl.addWidget(QtWidgets.QLabel(self.tr("Turn the dialog and notifications on or off")))
on_off_qhl.addStretch(1)
on_off_qhl.addWidget(self.turn_on_off_qcb)
self.setLayout(on_off_qhl)