本文整理汇总了Python中qtpy.QtWidgets.QCheckBox.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Python QCheckBox.setLayout方法的具体用法?Python QCheckBox.setLayout怎么用?Python QCheckBox.setLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtpy.QtWidgets.QCheckBox
的用法示例。
在下文中一共展示了QCheckBox.setLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: insert_row
# 需要导入模块: from qtpy.QtWidgets import QCheckBox [as 别名]
# 或者: from qtpy.QtWidgets.QCheckBox import setLayout [as 别名]
def insert_row(self, row=-1,
title='',
sample_runs='',
sample_mass_density='N/A',
sample_chemical_formula='N/A',
packing_fraction='N/A',
align_and_focus_args={},
sample_placzek_arguments={},
normalization_placzek_arguments={}):
self.table_ui.insertRow(row)
self.set_row_height(row, COLUMN_DEFAULT_HEIGHT)
_list_ui_to_unlock = [self.table_ui]
_dimension_widgets = {'label': None, 'value': 'N/A', 'units': None}
_full_dimension_widgets = {'radius': copy.deepcopy(_dimension_widgets),
'radius2': copy.deepcopy(_dimension_widgets),
'height': copy.deepcopy(_dimension_widgets)}
_text_button = {'text': None, 'button': None}
_mass_density_options = {'value': "N/A",
"selected": False}
_mass_density_infos = {'number_density': copy.deepcopy(_mass_density_options),
'mass_density': copy.deepcopy(_mass_density_options),
'mass': copy.deepcopy(_mass_density_options),
'molecular_mass': np.NaN,
'total_number_of_atoms': np.NaN,
}
_material_infos = {'mantid_format': None,
'addie_format': None}
_mass_density_infos['mass_density']["selected"] = True
_master_table_row_ui = {'active': None,
'title': None,
'sample': {'runs': None,
'background': {'runs': None,
'background': None,
},
'material': copy.deepcopy(_text_button),
'material_infos': copy.deepcopy(_material_infos),
'mass_density': copy.deepcopy(_text_button),
'mass_density_infos': copy.deepcopy(_mass_density_infos),
'packing_fraction': None,
'geometry': copy.deepcopy(_full_dimension_widgets),
'shape': None,
'abs_correction': None,
'mult_scat_correction': None,
'inelastic_correction': None,
'placzek_button': None,
'placzek_infos': None,
},
'normalization': {'runs': None,
'background': {'runs': None,
'background': None,
},
'material': copy.deepcopy(_text_button),
'material_infos': copy.deepcopy(_material_infos),
'mass_density': copy.deepcopy(_text_button),
'mass_density_infos': copy.deepcopy(_mass_density_infos),
'packing_fraction': None,
'geometry': copy.deepcopy(_full_dimension_widgets),
'shape': None,
'abs_correction': None,
'mult_scat_correction': None,
'inelastic_correction': None,
'placzek_button': None,
'placzek_infos': None,
},
'align_and_focus_args_button': None,
'align_and_focus_args_infos': {},
}
random_key = self.generate_random_key()
self.key = random_key
# block main table events
self.table_ui.blockSignals(True)
# column 0 (active or not checkBox)
_layout = QHBoxLayout()
_widget = QCheckBox()
_widget.setCheckState(QtCore.Qt.Checked)
_widget.setEnabled(True)
_master_table_row_ui['active'] = _widget
_spacer = QSpacerItem(40, 20,
QSizePolicy.Expanding,
QSizePolicy.Minimum)
_layout.addItem(_spacer)
_layout.addWidget(_widget)
_spacer = QSpacerItem(40, 20,
QSizePolicy.Expanding,
QSizePolicy.Minimum)
_layout.addItem(_spacer)
_layout.addStretch()
_new_widget = QWidget()
_new_widget.setLayout(_layout)
_widget.stateChanged.connect(lambda state=0, key=random_key:
self.main_window.master_table_select_state_changed(state, key))
column = 0
self.table_ui.setCellWidget(row, column, _new_widget)
#.........这里部分代码省略.........