本文整理汇总了Python中PySide.QtGui.QCheckBox.toggle方法的典型用法代码示例。如果您正苦于以下问题:Python QCheckBox.toggle方法的具体用法?Python QCheckBox.toggle怎么用?Python QCheckBox.toggle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QCheckBox
的用法示例。
在下文中一共展示了QCheckBox.toggle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initUI
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import toggle [as 别名]
def initUI(self):
grp = QGroupBox('Model')
grplay = QGridLayout()
name = QLineEdit()
name.setText(self.mdl.name)
name.textChanged.connect(self.name_changed)
self.controls['name'] = name
grplay.addWidget(QLabel('Name'), 0, 0)
grplay.addWidget(name, 0, 1)
parent = QLineEdit()
parent.setText(self.mdl.parent_name)
self.controls['parent'] = parent
grplay.addWidget(QLabel('Parent'), 0, 2)
grplay.addWidget(parent, 0, 3)
type_ = QComboBox()
type_.addItems(self.types)
type_.setCurrentIndex(self.types2[self.mdl.model_type])
self.controls['type'] = type_
grplay.addWidget(QLabel('Type'), 1, 0)
grplay.addWidget(type_, 1, 1)
vis = QCheckBox()
if self.mdl.vis:
vis.toggle()
self.controls['vis'] = vis
grplay.addWidget(QLabel('Hidden'), 1, 2)
grplay.addWidget(vis, 1, 3)
buttonlay = QHBoxLayout()
collprim = QPushButton('Collision Primitive')
buttonlay.addWidget(collprim)
collprim.clicked.connect(self.edit_collprim)
deformers = QPushButton('Deformers')
deformers.clicked.connect(self.edit_deformers)
buttonlay.addWidget(deformers)
bbox_btn = QPushButton('Bounding Box')
bbox_btn.clicked.connect(self.edit_bbox)
trans = QPushButton('Transform')
trans.clicked.connect(self.edit_tran)
buttonlay.addWidget(bbox_btn)
buttonlay.addWidget(trans)
buttonlay2 = QHBoxLayout()
validate = QPushButton('Validate')
validate.clicked.connect(self.validate)
uvs = QPushButton('UVs')
uvs.clicked.connect(self.show_uvs)
buttonlay2.addWidget(validate)
buttonlay2.addWidget(uvs)
buttonlay2.addStretch()
grplay.addLayout(buttonlay, 2, 0, 1, 4)
grplay.addLayout(buttonlay2, 3, 0, 1, 4)
grp.setLayout(grplay)
geogrp = QGroupBox('Geometry')
geolay = QHBoxLayout()
self.geometries = QListWidget()
self.geometries.addItems(['{0} - {1}'.format(ind, geo.classname) for ind, geo in enumerate(self.mdl.segments)])
geolay.addStretch()
geolay.addWidget(self.geometries)
edit_geo = QPushButton('Edit')
edit_geo.clicked.connect(self.edit_geo)
geolay.addWidget(edit_geo)
geogrp.setLayout(geolay)
btns = QHBoxLayout()
save = QPushButton('Save')
save.clicked.connect(self.save)
cancel = QPushButton('Cancel')
cancel.clicked.connect(self.close)
self.status = QLabel('Model Edit Mode')
btns.addWidget(self.status)
btns.addStretch()
btns.addWidget(save)
btns.addWidget(cancel)
mainlay = QVBoxLayout()
#.........这里部分代码省略.........
示例2: initUI
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import toggle [as 别名]
def initUI(self):
grp = QGroupBox('Material')
grplay = QGridLayout()
name = QLineEdit()
name.setText(self.mat.name)
self.controls['name'] = name
tex0 = QLineEdit()
tex0.setText(self.mat.tex0)
self.controls['tex0'] = tex0
tex1 = QLineEdit()
tex1.setText(self.mat.tex1)
self.controls['tex1'] = tex1
tex2 = QLineEdit()
tex2.setText(self.mat.tex2)
self.controls['tex2'] = tex2
tex3 = QLineEdit()
tex3.setText(self.mat.tex3)
self.controls['tex3'] = tex3
flags = QGroupBox('Flags')
fllay = QGridLayout()
for ind, flag in enumerate(self.mat.flags):
fllay.addWidget(QLabel(self.pretty_flags[flag[0]]), ind, 0)
box = QCheckBox()
fllay.addWidget(box, ind, 1)
if flag[1]:
box.toggle()
self.controls[flag[0]] = box
fllay.addWidget(QLabel('<b>RenderType</b>'), 8, 0)
numbox = QComboBox()
numbox.addItems(self.render_types)
numbox.setCurrentIndex(self.mat.render_type)
fllay.addWidget(numbox)
self.controls['render_type'] = numbox
fllay.addWidget(QLabel('<b>Data0</b>'), 9, 0)
d0 = QSpinBox()
d0.setValue(self.mat.data0)
d0.setMinimum(0)
d0.setMaximum(255)
fllay.addWidget(d0)
self.controls['data0'] = d0
fllay.addWidget(QLabel('<b>Data1</b>'), 10, 0)
d1 = QSpinBox()
d1.setValue(self.mat.data1)
d1.setMinimum(0)
d1.setMaximum(255)
fllay.addWidget(d1)
self.controls['data1'] = d1
flags.setLayout(fllay)
colors = QGroupBox('Colors')
collay = QGridLayout()
self.add_color('<b>Diffuse</b>', self.mat.diff_color, collay, 3)
self.add_color('<b>Specular</b>', self.mat.spec_color, collay, 4)
self.add_color('<b>Ambient</b>', self.mat.ambt_color, collay, 5)
colors.setLayout(collay)
grplay.addWidget(QLabel('<b>Name</b>'), 0, 0)
grplay.addWidget(name, 0, 1)
grplay.addWidget(QLabel('<b>Texture0</b>'), 1, 0)
grplay.addWidget(tex0, 1, 1)
grplay.addWidget(QLabel('<b>Texture1</b>'), 1, 2)
grplay.addWidget(tex1, 1, 3)
grplay.addWidget(QLabel('<b>Texture2</b>'), 2, 0)
grplay.addWidget(tex2, 2, 1)
grplay.addWidget(QLabel('<b>Texture3</b>'), 2, 2)
grplay.addWidget(tex3, 2, 3)
grplay.addWidget(QLabel('<b>Gloss</b>'), 3, 0)
gloss = QDoubleSpinBox()
gloss.setValue(self.mat.gloss)
grplay.addWidget(gloss, 3, 1)
self.controls['gloss'] = gloss
grplay.addWidget(colors, 4, 0, 1, 5)
grplay.addWidget(flags, 5, 0, 1, 3)
grp.setLayout(grplay)
btns = QHBoxLayout()
save = QPushButton('Save')
save.clicked.connect(self.save)
cancel = QPushButton('Cancel')
cancel.clicked.connect(self.close)
#.........这里部分代码省略.........