本文整理汇总了Python中PySide.QtGui.QGroupBox类的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox类的具体用法?Python QGroupBox怎么用?Python QGroupBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QGroupBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__( self, accordion, title, widget ):
QGroupBox.__init__(self, accordion)
# create the layout
layout = QVBoxLayout()
layout.setContentsMargins(6, 6, 6, 6)
layout.setSpacing(0)
layout.addWidget(widget)
self._accordianWidget = accordion
self._rolloutStyle = 2
self._dragDropMode = 0
self.setAcceptDrops(True)
self.setLayout(layout)
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.showMenu)
# create custom properties
self._widget = widget
self._collapsed = False
self._collapsible = True
self._clicked = False
self._customData = {}
# set common properties
self.setTitle(title)
示例2: __init__
def __init__(self, *args, **kwargs ):
QWidget.__init__( self, *args )
title = ""
if kwargs.has_key( 'title' ):
title = kwargs['title']
self.infoPath = cmds.about(pd=True) + "/sg/fingerWeightCopy/Widget_LoadVertex_%s.txt" % title
sgCmds.makeFile( self.infoPath )
vLayout = QVBoxLayout( self ); vLayout.setContentsMargins(0,0,0,0)
groupBox = QGroupBox( title )
groupBox.setAlignment( QtCore.Qt.AlignCenter )
vLayout.addWidget( groupBox )
hLayout = QHBoxLayout()
lineEdit = QLineEdit()
button = QPushButton("Load"); button.setFixedWidth( 50 )
hLayout.addWidget( lineEdit )
hLayout.addWidget( button )
groupBox.setLayout( hLayout )
self.lineEdit = lineEdit
QtCore.QObject.connect( button, QtCore.SIGNAL( "clicked()" ), self.loadVertex )
self.loadInfo()
示例3: __init__
def __init__(self, group_name, name_list, param_dict, help_instance = None, handler = None, help_dict = None):
QGroupBox.__init__(self, group_name)
the_layout = QVBoxLayout()
the_layout.setSpacing(5)
the_layout.setContentsMargins(1, 1, 1, 1)
self.setLayout(the_layout)
self.widget_dict = {}
self.is_popup = False
self.param_dict = param_dict
for txt in name_list:
qh = QHBoxLayout()
cb = QCheckBox(txt)
qh.addWidget(cb)
cb.setFont(QFont('SansSerif', 12))
param_widgets = {}
for key, val in param_dict.items():
if type(val) == list: #
param_widgets[key] = qHotField(key, type(val[0]), val[0], value_list=val, pos="top")
else:
param_widgets[key] = qHotField(key, type(val), val, pos="top")
qh.addWidget(param_widgets[key])
qh.addStretch()
the_layout.addLayout(qh)
if handler != None:
cb.toggled.connect(handler)
self.widget_dict[txt] = [cb, param_widgets]
if (help_dict != None) and (help_instance != None):
if txt in help_dict:
help_button_widget = help_instance.create_button(txt, help_dict[txt])
qh.addWidget(help_button_widget)
return
示例4: buildAttributeGroupBox
def buildAttributeGroupBox(self):
"""Layout/construct the AttributeScene UI for this tab."""
groupBox = QGroupBox("Attribute Policy (Colors)")
layout = QVBoxLayout()
# agent.propagate_attribute_scenes
self.attr_propagate = QCheckBox(
"Propagate attribute scene " + "information (e.g. color maps) to other modules."
)
self.attr_propagate.setChecked(self.agent.propagate_attribute_scenes)
self.attr_propagate.stateChanged.connect(self.attrPropagateChanged)
# We only allow this change if the parent does not propagate
if self.agent.parent().propagate_attribute_scenes:
self.attr_propagate.setDisabled(True)
# agent.apply_attribute_scenes
self.attr_applyScene = QCheckBox("Apply attribute scene information " + "from other modules.")
self.attr_applyScene.setChecked(self.agent.apply_attribute_scenes)
self.attr_applyScene.stateChanged.connect(self.attrApplyChanged)
layout.addWidget(self.attr_applyScene)
layout.addItem(QSpacerItem(5, 5))
layout.addWidget(self.attr_propagate)
groupBox.setLayout(layout)
return groupBox
示例5: _buildResultsPanel
def _buildResultsPanel(self):
'''
Creates the sub-panel containing displays widgets for informing the
user on the results of running the algorithm.
'''
self._doneLbl = QLabel("No", self._window)
self._solvableLbl = QLabel("Yes", self._window)
#_doneLbl is highlighted green upon successful algorithm completion
pal = self._doneLbl.palette()
pal.setColor(QPalette.Window, Qt.green)
self._doneLbl.setPalette(pal)
#_solvableLbl is highlighted red if the world model isn't solvable
pal = self._solvableLbl.palette()
pal.setColor(QPalette.Window, Qt.red)
self._solvableLbl.setPalette(pal)
layout = QGridLayout()
layout.addWidget(QLabel("Path Found:"), 0, 0)
layout.addWidget(self._doneLbl, 0, 1)
layout.addWidget(QLabel("Is Solvable:"), 1, 0)
layout.addWidget(self._solvableLbl, 1, 1)
grpBx = QGroupBox("Results")
grpBx.setLayout(layout)
grpBx.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
return grpBx
示例6: _buildSetupPanel
def _buildSetupPanel(self):
'''
Creates the sub-panel containing control widgets for re-initializing
the world on demand.
'''
self._percentLbl = QLabel("%")
self._setupBtn = QPushButton("Setup", self._window)
self._setupBtn.clicked.connect(self._onSetup)
self._percentObstacleSldr = QSlider(Qt.Horizontal, self._window)
self._percentObstacleSldr.setTickPosition(QSlider.TickPosition.TicksBelow)
self._percentObstacleSldr.setTickInterval(10)
self._percentObstacleSldr.setMinimum(0)
self._percentObstacleSldr.setMaximum(100)
self._percentObstacleSldr.valueChanged.connect(self._onPercentSlideChange)
self._percentObstacleSldr.setValue(33)
layout = QGridLayout()
layout.addWidget(self._setupBtn, 0, 0, 1, 2)
layout.addWidget(QLabel("Percent Occupied:"), 1, 0)
layout.addWidget(self._percentLbl, 1, 1)
layout.addWidget(self._percentObstacleSldr, 2, 0, 1, 2)
grpBx = QGroupBox("Setup Controls")
grpBx.setLayout(layout)
grpBx.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
return grpBx
示例7: __init__
def __init__(self, parent,silhouette,completeness,homogeneity,v_score,AMI,ARS):
QDialog.__init__( self, parent )
layout = QVBoxLayout()
viewLayout = QFormLayout()
viewLayout.addRow(QLabel('Silhouette score: '),QLabel(silhouette))
viewLayout.addRow(QLabel('Completeness: '),QLabel(completeness))
viewLayout.addRow(QLabel('Homogeneity: '),QLabel(homogeneity))
viewLayout.addRow(QLabel('V score: '),QLabel(v_score))
viewLayout.addRow(QLabel('Adjusted mutual information: '),QLabel(AMI))
viewLayout.addRow(QLabel('Adjusted Rand score: '),QLabel(ARS))
viewWidget = QGroupBox()
viewWidget.setLayout(viewLayout)
layout.addWidget(viewWidget)
#Accept cancel
self.acceptButton = QPushButton('Ok')
self.cancelButton = QPushButton('Cancel')
self.acceptButton.clicked.connect(self.accept)
self.cancelButton.clicked.connect(self.reject)
hbox = QHBoxLayout()
hbox.addWidget(self.acceptButton)
hbox.addWidget(self.cancelButton)
ac = QWidget()
ac.setLayout(hbox)
layout.addWidget(ac)
self.setLayout(layout)
示例8: _buildSpeedPanel
def _buildSpeedPanel(self):
'''
Creates the sub-panel containing control widgets for controlling the
speed of execution of the algorithm.
'''
self._runBtn = QPushButton("Run", self._window)
self._stepBtn = QPushButton("Step Once", self._window)
self._runBtn.clicked.connect(self._onRun)
self._stepBtn.clicked.connect(self._onStep)
slowRadio = QRadioButton('Slow', self._window)
medRadio = QRadioButton('Medium', self._window)
fastRadio = QRadioButton('Fast', self._window)
notVisRadio = QRadioButton('Not visible', self._window)
slowRadio.setChecked(True)
self._speedGroup = QButtonGroup(self._window)
self._speedGroup.addButton(slowRadio, 0)
self._speedGroup.addButton(medRadio, 1)
self._speedGroup.addButton(fastRadio, 2)
self._speedGroup.addButton(notVisRadio, 3)
self._speedGroup.buttonClicked.connect(self._onSpeedChange)
layout = QVBoxLayout()
layout.addWidget(self._runBtn)
layout.addWidget(self._stepBtn)
layout.addWidget(slowRadio)
layout.addWidget(medRadio)
layout.addWidget(fastRadio)
layout.addWidget(notVisRadio)
grpBx = QGroupBox("Run Controls")
grpBx.setLayout(layout)
grpBx.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
return grpBx
示例9: buildWorkFrame
def buildWorkFrame(self):
"""Creates the grouped set of widgets that allow users to build
basic Clause objects.
"""
groupBox = QGroupBox("Clause Workspace")
layout = QHBoxLayout(groupBox)
attributeCompleter = QCompleter(self.attributes)
attributeCompleter.setCompletionMode(QCompleter.InlineCompletion)
self.dropAttribute = DropLineEdit(self, self.mframe.agent.datatree, "",
attributeCompleter)
self.dropRelation = DropTextLabel("__")
self.dropValue = FilterValueLineEdit(groupBox,
self.mframe.agent.datatree, self.dropAttribute)
# Clear dropValue when dropAttribute changes
self.dropAttribute.textChanged.connect(self.dropValue.clear)
# Enter in dropValue works like addButton
self.dropValue.returnPressed.connect(self.addClause)
self.addButton = QPushButton("Add", groupBox)
self.addButton.clicked.connect(self.addClause)
layout.addWidget(self.dropAttribute)
layout.addItem(QSpacerItem(5,5))
layout.addWidget(self.dropRelation)
layout.addItem(QSpacerItem(5,5))
layout.addWidget(self.dropValue)
layout.addItem(QSpacerItem(5,5))
layout.addWidget(self.addButton)
groupBox.setLayout(layout)
return groupBox
示例10: __init__
def __init__(self,parent=None):
super(QtReducePreferencesComputation,self).__init__(parent)
reduceGroup = QGroupBox("Reduce")
self.reduceBinary = QLineEdit()
# font = self.reduceBinary.font()
# font.setFamily(QSettings().value("worksheet/fontfamily",
# QtReduceDefaults.FONTFAMILY))
# self.reduceBinary.setFont(font)
self.reduceBinary.setText(QSettings().value("computation/reduce",
QtReduceDefaults.REDUCE))
self.reduceBinary.editingFinished.connect(self.editingFinishedHandler)
reduceLayout = QFormLayout()
reduceLayout.addRow(self.tr("Reduce Binary"),self.reduceBinary)
reduceGroup.setLayout(reduceLayout)
mainLayout = QVBoxLayout()
mainLayout.addWidget(reduceGroup)
self.setLayout(mainLayout)
示例11: setup_general_server_group
def setup_general_server_group(self):
""" Setup the 'Server' group in the 'General' tab.
Returns:
--------
A QGroupBox widget
"""
group = QGroupBox('Server')
layout = QFormLayout()
layout.setFieldGrowthPolicy(QFormLayout.AllNonFixedFieldsGrow)
email, password = self.auth_credentials()
self.email_edit = QLineEdit(email)
self.email_edit.textChanged.connect(self.update_auth)
layout.addRow('Email', self.email_edit)
self.password_edit = QLineEdit(password)
self.password_edit.setEchoMode(QLineEdit.Password)
self.password_edit.textChanged.connect(self.update_auth)
layout.addRow('Password', self.password_edit)
show_password_widget = QCheckBox()
show_password_widget.stateChanged.connect(self.on_show_password_toggle)
layout.addRow('Show password', show_password_widget)
test_authentication_button = QPushButton('Test Authentication')
test_authentication_button.clicked.connect(self.on_test_authentication)
layout.addRow(test_authentication_button)
group.setLayout(layout)
return group
示例12: _initUI
def _initUI(self):
# Variables
result = self.result()
transitions = sorted(result.iter_transitions())
transition0 = transitions[0]
model = _TransitionListModel(transitions)
# Widgets
self._chk_errorbar = QCheckBox("Show error bars")
self._chk_errorbar.setChecked(True)
self._cb_transition = QComboBox()
self._cb_transition.setModel(model)
self._cb_transition.setCurrentIndex(0)
self._chk_pg = QCheckBox("No absorption, no fluorescence")
state = result.exists(transition0, True, False, False, False)
self._chk_pg.setEnabled(state)
self._chk_pg.setChecked(state)
self._chk_eg = QCheckBox("With absorption, no fluorescence")
state = result.exists(transition0, True, True, False, False)
self._chk_eg.setEnabled(state)
self._chk_eg.setChecked(state)
self._chk_pt = QCheckBox("No absorption, with fluorescence")
state = result.exists(transition0, True, False, True, True)
self._chk_pt.setEnabled(state)
self._chk_pt.setChecked(state)
self._chk_et = QCheckBox("With absorption, with fluorescence")
state = result.exists(transition0, True, True, True, True)
self._chk_et.setEnabled(state)
self._chk_et.setChecked(state)
# Layouts
layout = _ResultToolItem._initUI(self)
layout.addRow(self._chk_errorbar)
layout.addRow("Transition", self._cb_transition)
boxlayout = QVBoxLayout()
boxlayout.addWidget(self._chk_pg)
boxlayout.addWidget(self._chk_eg)
boxlayout.addWidget(self._chk_pt)
boxlayout.addWidget(self._chk_et)
box_generated = QGroupBox("Curves")
box_generated.setLayout(boxlayout)
layout.addRow(box_generated)
# Signals
self._cb_transition.currentIndexChanged.connect(self._onTransitionChanged)
self._chk_pg.stateChanged.connect(self.stateChanged)
self._chk_eg.stateChanged.connect(self.stateChanged)
self._chk_pt.stateChanged.connect(self.stateChanged)
self._chk_et.stateChanged.connect(self.stateChanged)
self._chk_errorbar.stateChanged.connect(self.stateChanged)
return layout
示例13: __init__
def __init__(self, renderController, parent=None):
super(RenderSlicerParamWidget, self).__init__(parent=parent)
self.renderController = renderController
self.renderController.slicesChanged.connect(self.setSlices)
self.renderController.clippingBoxChanged.connect(self.showsClippingBox)
self.renderController.clippingPlanesChanged.connect(self.showsClippingPlanes)
self.sliceLabelTexts = ["Axial:", "Coronal:", "Sagittal:"]
self.sliceLabels = [QLabel(text) for text in self.sliceLabelTexts]
self.sliceCheckBoxes = [QCheckBox() for i in range(3)]
for index in range(3):
self.sliceCheckBoxes[index].clicked.connect(self.checkBoxChanged)
self.sliceLabels[index].setAlignment(Qt.AlignRight | Qt.AlignVCenter)
self.sliceCheckBoxes[index].setEnabled(True)
slicesLayout = QGridLayout()
slicesLayout.setAlignment(Qt.AlignTop)
for index in range(3):
slicesLayout.addWidget(self.sliceLabels[index], index+1, 0)
slicesLayout.addWidget(self.sliceCheckBoxes[index], index+1, 1)
self.slicesGroupBox = QGroupBox()
self.slicesGroupBox.setTitle("Visible slices")
self.slicesGroupBox.setLayout(slicesLayout)
# Create option to show clipping box
self.clippingCheckBox = QCheckBox()
self.clippingCheckBox.setChecked(self.renderController.clippingBox)
self.clippingCheckBox.clicked.connect(self.clippingCheckBoxChanged)
self.clippingPlanesCheckBox = QCheckBox()
self.clippingPlanesCheckBox.setChecked(self.renderController.clippingPlanes)
self.clippingPlanesCheckBox.clicked.connect(self.clippingPlanesCheckBoxChanged)
self.resetButton = QPushButton("Reset")
self.resetButton.clicked.connect(self.resetClippingBox)
clippingLabel = QLabel("Clipping box:")
clippingLabel.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
clippingPlanesLabel = QLabel("Clipping planes:")
clippingPlanesLabel.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
clipLayout = QGridLayout()
clipLayout.addWidget(clippingLabel, 0, 0)
clipLayout.addWidget(self.clippingCheckBox, 0, 1)
clipLayout.addWidget(clippingPlanesLabel, 1, 0)
clipLayout.addWidget(self.clippingPlanesCheckBox, 1, 1)
clipLayout.addWidget(self.resetButton, 2, 0)
self.clippingGroupBox = QGroupBox()
self.clippingGroupBox.setTitle("Clipping box")
self.clippingGroupBox.setLayout(clipLayout)
# Create a nice layout for the labels
layout = QGridLayout()
layout.setAlignment(Qt.AlignTop)
layout.addWidget(self.slicesGroupBox, 0, 0)
layout.addWidget(self.clippingGroupBox, 0, 1)
self.setLayout(layout)
示例14: __init__
def __init__(self, title, labels):
QGroupBox.__init__(self, title)
self.layout = QBoxLayout(QBoxLayout.LeftToRight)
self.buttons = {}
for label in labels:
button = QRadioButton(label)
self.buttons[label] = button
self.layout.addWidget(button)
self.setLayout(self.layout)
示例15: create_groupbox_layout
def create_groupbox_layout(self, is_vertical, parent, label, owner):
""" Returns a new GUI toolkit neutral vertical layout manager for a
groupbox.
"""
gb = QGroupBox(label, check_parent(parent))
gb.owner = owner
bl = self.create_box_layout(is_vertical)
gb.setLayout(bl())
return (control_adapter_for(gb), bl)