本文整理汇总了Python中PySide2.QtWidgets.QRadioButton方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QRadioButton方法的具体用法?Python QtWidgets.QRadioButton怎么用?Python QtWidgets.QRadioButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QRadioButton方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: itemContourAnalysis
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QRadioButton [as 别名]
def itemContourAnalysis(self):
box = QtWidgets.QVBoxLayout()
vlayout = QtWidgets.QVBoxLayout()
gb = QtWidgets.QGroupBox('Select contour to analyze')
self.b1 = QtWidgets.QRadioButton('Original')
self.b2 = QtWidgets.QRadioButton('Refined')
self.b2.setChecked(True)
vlayout.addWidget(self.b1)
vlayout.addWidget(self.b2)
gb.setLayout(vlayout)
box.addWidget(gb)
vlayout = QtWidgets.QVBoxLayout()
self.cgb = QtWidgets.QGroupBox('Select plot quantity')
self.cpb1 = QtWidgets.QRadioButton('Gradient')
self.cpb2 = QtWidgets.QRadioButton('Curvature')
self.cpb3 = QtWidgets.QRadioButton('Radius of Curvature')
self.cpb1.setChecked(True)
vlayout.addWidget(self.cpb1)
vlayout.addWidget(self.cpb2)
vlayout.addWidget(self.cpb3)
self.cgb.setLayout(vlayout)
self.cgb.setEnabled(False)
box.addWidget(self.cgb)
analyzeButton = QtWidgets.QPushButton('Analyze Contour')
analyzeButton.setGeometry(10, 10, 200, 50)
box.addWidget(analyzeButton)
box.addStretch(1)
self.item_ca = QtWidgets.QWidget()
self.item_ca.setLayout(box)
analyzeButton.clicked.connect(self.analyzeAirfoil)
示例2: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QRadioButton [as 别名]
def __init__ (self, parent):
QtWidgets.QDialog.__init__(self, parent)
self.setWindowTitle("Export depth maps")
self.btnQuit = QtWidgets.QPushButton("&Close")
self.btnP1 = QtWidgets.QPushButton("&Export")
self.pBar = QtWidgets.QProgressBar()
self.pBar.setTextVisible(False)
# self.selTxt =QtWidgets.QLabel()
# self.selTxt.setText("Apply to:")
self.radioBtn_all = QtWidgets.QRadioButton("Apply to all cameras")
self.radioBtn_sel = QtWidgets.QRadioButton("Apply to selected")
self.radioBtn_all.setChecked(True)
self.radioBtn_sel.setChecked(False)
self.formTxt = QtWidgets.QLabel()
self.formTxt.setText("Export format:")
self.formCmb = QtWidgets.QComboBox()
self.formCmb.addItem("1-band F32")
self.formCmb.addItem("Grayscale 8-bit")
self.formCmb.addItem("Grayscale 16-bit")
# creating layout
layout = QtWidgets.QGridLayout()
layout.setSpacing(10)
layout.addWidget(self.radioBtn_all, 0, 0)
layout.addWidget(self.radioBtn_sel, 1, 0)
layout.addWidget(self.formTxt, 0, 1)
layout.addWidget(self.formCmb, 1, 1)
layout.addWidget(self.btnP1, 2, 0)
layout.addWidget(self.btnQuit, 2, 1)
layout.addWidget(self.pBar, 3, 0, 1, 2)
self.setLayout(layout)
QtCore.QObject.connect(self.btnP1, QtCore.SIGNAL("clicked()"), self.export_depth)
QtCore.QObject.connect(self.btnQuit, QtCore.SIGNAL("clicked()"), self, QtCore.SLOT("reject()"))
self.exec()
示例3: on_select_area
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QRadioButton [as 别名]
def on_select_area(self):
for node in self.radio_button_to_node.keys():
node.deleteLater()
self.radio_button_to_node.clear()
current_area = self.current_area
if not current_area:
self.new_node_button.setEnabled(False)
self.delete_node_button.setEnabled(False)
return
is_first = True
for node in sorted(current_area.nodes, key=lambda x: x.name):
button = QRadioButton(self.points_of_interest_group)
button.setText(node.name)
self.radio_button_to_node[button] = node
if is_first:
self.selected_node_button = button
button.setChecked(is_first)
button.toggled.connect(self.on_select_node)
is_first = False
self.verticalLayout.addWidget(button)
self.new_node_button.setEnabled(True)
self.delete_node_button.setEnabled(len(current_area.nodes) > 1)
self.update_selected_node()
示例4: decensorClicked
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QRadioButton [as 别名]
def decensorClicked(self):
self.decensorButton.setEnabled(False)
self.progressMessage.clear()
self.progressCursor.insertText("Decensoring has begun!\n")
# for now, decensor is initiated when this app is started
# self.decensor = Decensor(text_edit = self.progressMessage, text_cursor = self.progressCursor, ui_mode = True)
#https://stackoverflow.com/questions/42349470/pyqt-find-checked-radiobutton-in-a-group
#set decensor to right settings
#censor type
censorTypeElements = self.censorTypeGroupBox.children()
censorButtons = [elem for elem in censorTypeElements if isinstance(elem, QRadioButton)]
for cb in censorButtons:
if cb.isChecked():
censorType = cb.text()
if censorType == 'Bar censor':
self.decensor.is_mosaic = False
else:
self.decensor.is_mosaic = True
#variations count
variationsElements = self.variationsGroupBox.children()
variationsButtons = [elem for elem in variationsElements if isinstance(elem, QRadioButton)]
for vb in variationsButtons:
if vb.isChecked():
variations = int(vb.text())
self.decensor.variations = variations
self.decensorButton.setEnabled(False)
self.decensor.start()
# decensor.decensor_all_images_in_folder()
# #centers the main window
示例5: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QRadioButton [as 别名]
def __init__(self, hotboxes, parent=None):
super(CreateHotboxDialog, self).__init__(parent)
self.setWindowTitle("Create new hotbox")
self.hotboxes = hotboxes
self.new = QtWidgets.QRadioButton("empty hotbox")
self.duplicate = QtWidgets.QRadioButton("duplicate existing hotbox")
self.duplicate.setEnabled(bool(self.hotboxes))
self.template = QtWidgets.QRadioButton("from template")
self.groupbutton = QtWidgets.QButtonGroup()
self.groupbutton.addButton(self.new, 0)
self.groupbutton.addButton(self.duplicate, 1)
self.groupbutton.addButton(self.template, 2)
self.new.setChecked(True)
self.existing = QtWidgets.QComboBox()
self.existing.addItems([hb['general']['name'] for hb in self.hotboxes])
self.template_combo = QtWidgets.QComboBox()
items = [hb['general']['name'] for hb in load_templates()]
self.template_combo.addItems(items)
self.up_layout = QtWidgets.QGridLayout()
self.up_layout.setContentsMargins(0, 0, 0, 0)
self.up_layout.setSpacing(0)
self.up_layout.addWidget(self.new, 0, 0)
self.up_layout.addWidget(self.duplicate, 1, 0)
self.up_layout.addWidget(self.existing, 1, 1)
self.up_layout.addWidget(self.template, 2, 0)
self.up_layout.addWidget(self.template_combo, 2, 1)
self.ok = QtWidgets.QPushButton('ok')
self.ok.released.connect(self.accept)
self.cancel = QtWidgets.QPushButton('cancel')
self.cancel.released.connect(self.reject)
self.down_layout = QtWidgets.QHBoxLayout()
self.down_layout.setContentsMargins(0, 0, 0, 0)
self.down_layout.addStretch(1)
self.down_layout.addWidget(self.ok)
self.down_layout.addWidget(self.cancel)
self.layout = QtWidgets.QVBoxLayout(self)
self.layout.setSpacing(12)
self.layout.addLayout(self.up_layout)
self.layout.addLayout(self.down_layout)