本文整理汇总了Python中PyQt4.QtGui.QGroupBox类的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox类的具体用法?Python QGroupBox怎么用?Python QGroupBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QGroupBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,parent):
QGroupBox.__init__(self,parent)
self.parent = parent
self.setMaximumHeight(130)
self.layout = QHBoxLayout(self)
self.layout.setMargin(10)
self.setTitle("Property")
lab1 = QLabel("Text: ")
lab2 = QLabel("Font: ")
lab3 = QLabel("Size: ")
self.lab4 = QLabel("x: ")
self.lab5 = QLabel("y: ")
self.lab6 = QLabel(": ")
self.led1 = QLineEdit()
self.led2 = QFontComboBox()
self.led3 = QComboBox()
for i in range(1,50):
self.led3.addItem(str(i))
self.layout.addWidget(lab1)
self.layout.addWidget(self.led1)
self.layout.addWidget(lab2)
self.layout.addWidget(self.led2)
self.layout.addWidget(lab3)
self.layout.addWidget(self.led3)
self.layout.addWidget(self.lab4)
self.layout.addWidget(self.lab5)
self.layout.addWidget(self.lab6)
示例2: buildAntispam
def buildAntispam(self, layout, row, col):
antispam = QGroupBox(self)
antispam.setTitle(tr('Antispam'))
antispam_layout = QFormLayout(antispam)
antispam_enable = QCheckBox()
info = QLabel(tr("This will add an <code>X-Spam-Score:</code> header "
"field to all the messages and add a <code>Subject:</code> line "
"beginning with *<i>SPAM</i>* and containing the original subject "
"to the messages detected as spam."))
info.setWordWrap(True)
antispam_layout.addRow(info)
antispam_layout.addRow(tr('Activate the antispam'), antispam_enable)
mark_spam_level = QDoubleSpinBox(self)
mark_spam_level.setDecimals(1)
antispam_layout.addRow(tr('Mark the message as spam if its score is greater than'), mark_spam_level)
deny_spam_level = QDoubleSpinBox(self)
deny_spam_level.setDecimals(1)
antispam_layout.addRow(tr('Refuse the message if its score is greater than'), deny_spam_level)
# enable/disable spam levels
self.connect(antispam_enable, SIGNAL('toggled(bool)'), mark_spam_level.setEnabled)
self.connect(antispam_enable, SIGNAL('toggled(bool)'), deny_spam_level.setEnabled)
# update config
self.connect(mark_spam_level, SIGNAL('valueChanged(double)'), self.setMarkSpamLevel)
self.connect(deny_spam_level, SIGNAL('valueChanged(double)'), self.setDenySpamLevel)
self.connect(antispam_enable, SIGNAL('clicked(bool)'), self.setAntispamEnabled)
layout.addWidget(antispam, row, col)
self.mainwindow.writeAccessNeeded(mark_spam_level, deny_spam_level)
return antispam_enable, mark_spam_level, deny_spam_level
示例3: _initialize
def _initialize(self):
## self.paramTPerm = self.field("paramTPerm")
self.tabs.clear()
self.total_answers = 0
self.radioGroups = {}
filas = int(self.paramNPerm.toString())
for x in range(filas):
mygroupbox = QScrollArea()
mygroupbox.setWidget(QWidget())
mygroupbox.setWidgetResizable(True)
myform = QHBoxLayout(mygroupbox.widget())
cols = self.paramNCols.toString().split(',')
ansID = 0
radioGroupList = {}
for col in cols:
mygroupboxCol = QGroupBox()
myformCol = QFormLayout()
mygroupboxCol.setLayout(myformCol)
for y in range(int(col)):
ansID += 1
radioGroupList[ansID] = QButtonGroup()
layoutRow = QHBoxLayout()
for j in range(int(self.paramNAlts.toString())):
myradio = QRadioButton(chr(97+j).upper())
layoutRow.addWidget(myradio)
radioGroupList[ansID].addButton(myradio)
self.total_answers += 1
myformCol.addRow(str(ansID), layoutRow)
myform.addWidget(mygroupboxCol)
self.radioGroups[chr(97+x).upper()] = radioGroupList
self.tabs.addTab(mygroupbox, _('Model ') + chr(97+x).upper())
示例4: _init_gui_tab_and_groupbox_widgets
def _init_gui_tab_and_groupbox_widgets(self):
#top area for main stuff
group_box_main_config = QGroupBox("Configuration")
main_config_layout = QFormLayout()
widget_delimiter = self._init_gui_delimiter_entries()
tab_widget = QTabWidget()
tab_widget.addTab(widget_delimiter, "delimiter")
tab_widget.addTab(self.color_choosing_widget, "colors")
#widget for bottom = save button
save_widget = QWidget()
layout_save_widget = QFormLayout()
save_button = QPushButton("save", self)
QObject.connect(save_button, SIGNAL('clicked()'), self._save_config)
layout_save_widget.addWidget(save_button)
save_widget.setLayout(layout_save_widget)
main_config_layout.addRow(self.checkbox_start_with_last_opened_file)
group_box_main_config.setLayout(main_config_layout)
tab_widget_layout = QVBoxLayout()
tab_widget_layout.addWidget(group_box_main_config)
tab_widget_layout.addWidget(tab_widget)
tab_widget_layout.addWidget(save_widget)
return tab_widget_layout
示例5: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
self.parent = parent
self.objets = parent.objets
self.panel = self.parent.parent.panel
self.canvas = self.parent.parent.canvas
self.islabel = self.parent.parent.islabel
self.sizer = QVBoxLayout()
if len(self.objets) is 1:
self.objet = self.objets[0]
style = QVBoxLayout()
style_box = QGroupBox(u"Style de l'objet")
style_box.setLayout(style)
style.addWidget(QLabel(u"Attention, ne modifiez ce contenu que si vous savez ce que vous faites."))
self.avance = QTextEdit()
self.avance.setMinimumSize(350, 200)
self.actualiser()
style.addWidget(self.avance)
self.sizer.addWidget(style_box)
ok = QPushButton('OK')
appliquer = QPushButton(u"Appliquer")
actualiser = QPushButton(u"Actualiser")
ok.clicked.connect(self.EvtOk)
appliquer.clicked.connect(self.EvtAppliquer)
actualiser.clicked.connect(self.actualiser)
boutons = QHBoxLayout()
boutons.addWidget(ok)
boutons.addWidget(appliquer)
boutons.addWidget(actualiser)
self.sizer.addLayout(boutons)
self.setLayout(self.sizer)
示例6: __init__
def __init__(self, id, logscale=False, style=True):
QGroupBox.__init__(self)
self.setTitle("Control Axes")
self.setToolTip("<p>Control if/how axes are drawn</p>")
self.xAxisCheckBox = QCheckBox("Show X axis")
self.xAxisCheckBox.setChecked(True)
self.yAxisCheckBox = QCheckBox("Show Y axis")
self.yAxisCheckBox.setChecked(True)
self.id = id
hbox = HBoxLayout()
hbox.addWidget(self.xAxisCheckBox)
hbox.addWidget(self.yAxisCheckBox)
vbox = VBoxLayout()
vbox.addLayout(hbox)
if logscale:
self.xLogCheckBox = QCheckBox("Logarithmic X axis")
self.yLogCheckBox = QCheckBox("Logarithmic Y axis")
hbox = HBoxLayout()
hbox.addWidget(self.xLogCheckBox)
hbox.addWidget(self.yLogCheckBox)
vbox.addLayout(hbox)
if style:
self.directionComboBox = QComboBox()
self.directionComboBox.addItems(["Parallel to axis",
"Horizontal",
"Perpendicualr to axis",
"Vertical"])
directionLabel = QLabel("Axis label style:")
directionLabel.setBuddy(self.directionComboBox)
hbox = HBoxLayout()
hbox.addWidget(directionLabel)
hbox.addWidget(self.directionComboBox)
vbox.addLayout(hbox)
self.setLayout(vbox)
示例7: __getTermGroupbox
def __getTermGroupbox( self ):
" Creates the term groupbox "
termGroupbox = QGroupBox( self )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
termGroupbox.sizePolicy().hasHeightForWidth() )
termGroupbox.setSizePolicy( sizePolicy )
layoutTerm = QVBoxLayout( termGroupbox )
self.__redirectRButton = QRadioButton( termGroupbox )
self.__redirectRButton.setText( "&Redirect to IDE" )
self.__redirectRButton.toggled.connect( self.__redirectedChanged )
layoutTerm.addWidget( self.__redirectRButton )
self.__autoRButton = QRadioButton( termGroupbox )
self.__autoRButton.setText( "Aut&o detection" )
layoutTerm.addWidget( self.__autoRButton )
self.__konsoleRButton = QRadioButton( termGroupbox )
self.__konsoleRButton.setText( "Default &KDE konsole" )
layoutTerm.addWidget( self.__konsoleRButton )
self.__gnomeRButton = QRadioButton( termGroupbox )
self.__gnomeRButton.setText( "gnome-&terminal" )
layoutTerm.addWidget( self.__gnomeRButton )
self.__xtermRButton = QRadioButton( termGroupbox )
self.__xtermRButton.setText( "&xterm" )
layoutTerm.addWidget( self.__xtermRButton )
return termGroupbox
示例8: __init__
def __init__(self, toolbox):
super(Articulations, self).__init__(toolbox, 'articulation',
i18n("Articulations"), symbol='articulation_prall',
tooltip=i18n("Different kinds of articulations and other signs."))
layout = QVBoxLayout(self)
layout.setSpacing(0)
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
# help text
self.setWhatsThis("<p>{0}</p><p>{1}</p>".format(
i18n("Click an articulation sign to add it to your document."),
i18n("If you select some music first, the articulation will "
"be added to all notes in the selection.")))
self.shorthands = QCheckBox(i18n("Allow shorthands"))
self.shorthands.setChecked(True)
self.shorthands.setToolTip(i18n(
"Use short notation for some articulations like staccato."))
layout.addWidget(self.shorthands)
self.titles = dict(ly.articulation.articulations(i18n))
for title, group in ly.articulation.groups(i18n):
box = QGroupBox(title)
layout.addWidget(box)
grid = QGridLayout()
grid.setSpacing(0)
box.setLayout(grid)
for num, (sign, title) in enumerate(group):
row, col = divmod(num, COLUMNS)
b = ActionButton(self, sign, title, 'articulation_' + sign,
tooltip='<b>{0}</b> (\\{1})'.format(title, sign))
grid.addWidget(b, row, col)
layout.addStretch()
示例9: __init__
def __init__(self, attribute, values, parent=None):
QGroupBox.__init__(self, attribute, parent)
self._attribute = attribute
self._current_items = []
self._defaults = {}
self._inputField = None
self._inputFieldType = None
self._insertIndex = -1
self._insertAtEnd = False
self._shortcuts = {}
# Setup GUI
self._layout = FloatingLayout()
self.setLayout(self._layout)
self._buttons = {}
self._labels = {}
#Abhishek : Add Label Dropdown
self.ann_input_combo = ExtendedCombo(self)
self._layout.insertWidget(0,self.ann_input_combo)
self.ann_input_combo.show()
self.modelItem = QStandardItemModel()
self.ann_input_combo.setModel(self.modelItem)
self.ann_input_combo.setModelColumn(0)
self.ann_input_combo.currentIndexChanged.connect(self.onAnnotationValueSelected)
# Add interface elements
self.updateValues(values)
示例10: __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)
示例11: initUI
def initUI(self):
# title
title = QLabel(self)
title.setText("User Instruction")
title.setAlignment(Qt.AlignCenter)
# user instruction
groupBox = QGroupBox()
text = QLabel(self)
text.setText("Create image montages and histograms from the interface:\nChoose option No. 1 to 5 on main interface.\nClick Enter to select the paths for input and output locations.\nEnjoy using the interface!")
self.setStyleSheet("QLabel { color: #8B4513; font-size: 16px;font-family: cursive, sans-serif;}")
title.setStyleSheet("QLabel { color: #8B4513; font-weight: 600;}")
# set layout
sbox = QVBoxLayout(self)
sbox.addWidget(text)
groupBox.setLayout(sbox)
vBoxLayout = QVBoxLayout()
vBoxLayout.addSpacing(15)
vBoxLayout.addWidget(title)
vBoxLayout.addWidget(groupBox)
vBoxLayout.addSpacing(15)
self.setLayout(vBoxLayout)
# set background as transparent
palette = QPalette()
palette.setBrush(QPalette.Background,QBrush(QPixmap()))
self.setPalette(palette)
示例12: __init__
def __init__(self, parent=None):
super(Calibrador, self).__init__(parent)
layout = QVBoxLayout()
self.btabrir = QPushButton('Abrir')
self.btabrir.clicked.connect(self.abrirArchivo)
layout.addWidget(self.btabrir)
self.gb1 = QGroupBox('Valores a Calibrar')
l1 = QVBoxLayout()
self.lx1 = QLabel('Archivo X1')
self.x1 = QLineEdit()
self.x1.setReadOnly(True)
l1.addWidget(self.lx1)
l1.addWidget(self.x1)
self.lx2 = QLabel('Archivo X2')
self.x2 = QLineEdit()
self.x2.setReadOnly(True)
l1.addWidget(self.lx2)
l1.addWidget(self.x2)
self.gb1.setLayout(l1)
layout.addWidget(self.gb1)
self.gb2 = QGroupBox('Valores de Referencia')
l2 = QVBoxLayout()
self.ly1 = QLabel('Archivo Y1')
self.y1 = QLineEdit()
self.y1.setReadOnly(True)
l2.addWidget(self.ly1)
l2.addWidget(self.y1)
self.ly2 = QLabel('Archivo Y2')
self.y2 = QLineEdit()
self.y2.setReadOnly(True)
l2.addWidget(self.ly2)
l2.addWidget(self.y2)
self.gb2.setLayout(l2)
layout.addWidget(self.gb2)
self.btlimpiar = QPushButton('Limpiar')
self.btlimpiar.clicked.connect(self.limpiar)
layout.addWidget(self.btlimpiar)
self.contents = QTextEdit()
self.contents.setReadOnly(True)
layout.addWidget(self.contents)
self.btcalibrar = QPushButton('Calibrar')
self.btcalibrar.clicked.connect(self.calibrar)
layout.addWidget(self.btcalibrar)
self.setLayout(layout)
self.setWindowTitle('Calibrador Radiométrico')
self.setWindowIcon(QIcon('c:/Users/Juanjo/Pictures/CONAE_chico_transp.ico'))
示例13: __init__
def __init__(self, buttonText, imagePath, buttonCallback, imageSize, parent=None):
QWidget.__init__(self, parent)
icon = QLabel(self)
icon.setPixmap(QPixmap(imagePath).scaled(imageSize, imageSize))
button = QPushButton(buttonText)
button.clicked.connect(buttonCallback)
vbox = QVBoxLayout()
vbox.addStretch(1)
vbox.addWidget(icon, alignment=Qt.AlignHCenter)
vbox.addSpacing(20)
vbox.addWidget(button)
vbox.addStretch(1)
# Add some horizontal padding
hbox = QHBoxLayout()
hbox.addSpacing(10)
hbox.addLayout(vbox)
hbox.addSpacing(10)
groupBox = QGroupBox()
groupBox.setLayout(hbox)
hbox = QHBoxLayout()
hbox.addStretch(1)
hbox.addWidget(groupBox)
hbox.addStretch(1)
self.setLayout(hbox)
示例14: initAppletDrawerUi
def initAppletDrawerUi(self):
training_controls = EdgeTrainingGui.createDrawerControls(self)
training_controls.layout().setContentsMargins(5,0,5,0)
training_layout = QVBoxLayout()
training_layout.addWidget( training_controls )
training_layout.setContentsMargins(0,0,0,0)
training_box = QGroupBox( "Training", parent=self )
training_box.setLayout(training_layout)
training_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
multicut_controls = MulticutGuiMixin.createDrawerControls(self)
multicut_controls.layout().setContentsMargins(5,0,5,0)
multicut_layout = QVBoxLayout()
multicut_layout.addWidget( multicut_controls )
multicut_layout.setContentsMargins(0,0,0,0)
multicut_box = QGroupBox( "Multicut", parent=self )
multicut_box.setLayout(multicut_layout)
multicut_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
drawer_layout = QVBoxLayout()
drawer_layout.addWidget(training_box)
drawer_layout.addWidget(multicut_box)
drawer_layout.setSpacing(2)
drawer_layout.setContentsMargins(5,5,5,5)
drawer_layout.addSpacerItem( QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) )
self._drawer = QWidget(parent=self)
self._drawer.setLayout(drawer_layout)
示例15: _drawButtons
def _drawButtons(self, logoFnam):
gbox = QGroupBox()
spol = QSizePolicy()
spol.horizontalPolicy = QSizePolicy.Maximum
gbox.setSizePolicy(spol)
vbox = QVBoxLayout()
if os.path.isfile(logoFnam):
img = QPixmap(logoFnam) #.scaled(64, 64)
lblLogo = QLabel()
lblLogo.setPixmap(img)
lblLogo.setAlignment(Qt.AlignTop | Qt.AlignRight)
vbox.addWidget(lblLogo)
#vbox.addSpacing(3)
self.butSave = self._drawButton(vbox, "M&odify", 'closeSave')
font = QFont()
font.setBold(True)
self.butSave.setFont(font)
self.butCancel = self._drawButton(vbox, "Cancel", 'closeCancel', True)
vbox.addSpacing(36)
self.butAddRule = self._drawButton(vbox, "Add Rule", 'addRule', True)
self.butCopyRule = self._drawButton(vbox, "Copy Rule", 'copyRule')
self.butDelRule = self._drawButton(vbox, "Delete Rule", 'delRule')
self.butMoveRuleUp = self._drawButton(vbox, "Move Rule Up", 'moveRuleUp')
self.butMoveRuleDn = self._drawButton(vbox, "Move Rule Down", 'moveRuleDown')
vbox.addSpacing(24)
self.butAddCond = self._drawButton(vbox, "Add Condition", 'addCond')
self.butDelCond = self._drawButton(vbox, "Delete Condition", 'delCond')
vbox.addSpacing(15)
self.butAddAction = self._drawButton(vbox, "Add Action", 'addAction')
self.butDelAction = self._drawButton(vbox, "Delete Action", 'delAction')
gbox.setLayout(vbox)
self.mainHSplit.addWidget(gbox)