本文整理汇总了Python中PyQt4.QtGui.QGroupBox.layout方法的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox.layout方法的具体用法?Python QGroupBox.layout怎么用?Python QGroupBox.layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGroupBox
的用法示例。
在下文中一共展示了QGroupBox.layout方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _add_log_box
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
def _add_log_box(self):
box = QGroupBox("Application log")
box.setLayout(QHBoxLayout(box))
self.log_area = QTextBrowser(box)
self.log_area.setLineWrapMode(QTextEdit.NoWrap)
box.layout().addWidget(self.log_area)
self.layout().addWidget(box)
示例2: _initAppletDrawerUic
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
def _initAppletDrawerUic(self):
super(TrackingBaseDataExportGui, self)._initAppletDrawerUic()
from PyQt4.QtGui import QGroupBox, QPushButton, QVBoxLayout
group = QGroupBox("Export Object Feature and Tracking Table", self.drawer)
group.setLayout(QVBoxLayout())
self.drawer.layout().addWidget(group)
btn = QPushButton("Configure and export", group)
btn.clicked.connect(self.show_export_dialog)
group.layout().addWidget(btn)
示例3: _add_additional_prefs
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
def _add_additional_prefs(self):
box = QGroupBox("Additional Preferences")
box.setLayout(QHBoxLayout(box))
log_btn = QPushButton("View Log", box)
log_btn.clicked.connect(self.open_log_file)
reset_btn = QPushButton("Reset Settings", box)
reset_btn.clicked.connect(Settings().reset)
box.layout().addWidget(log_btn)
box.layout().addWidget(reset_btn)
self.layout().addWidget(box)
示例4: _add_dota_box
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
def _add_dota_box(self):
box = QGroupBox("Dota Location")
box.setLayout(QHBoxLayout(box))
self.dota_path = QLineEdit(box)
self.dota_path.setReadOnly(True)
self.dota_path.setText(Settings().get("dota_path"))
change_btn = QPushButton("Change...", box)
change_btn.clicked.connect(self.change_dota_path)
box.layout().addWidget(self.dota_path)
box.layout().addWidget(change_btn)
self.layout().addWidget(box)
示例5: __init__
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
def __init__(self, parent=None, signalManager=None,
title="CSV File Import"):
OWWidget.__init__(self, parent, signalManager, title,
wantMainArea=False, noReport=True)
self.symbol_DC = ""
self.symbol_DK = ""
#: List of recent opened files.
self.recent_files = []
#: Current selected file name
self.selected_file = None
#: Variable reuse flag
self.create_new_on = 2
#: Display advanced var reuse options
self.show_advanced = False
self.loadSettings()
self.recent_files = filter(os.path.exists, self.recent_files)
self._loader = None
self._invalidated = False
self._datareport = None
layout = QHBoxLayout()
OWGUI.widgetBox(self.controlArea, "File", orientation=layout)
icons = standard_icons(self)
self.recent_combo = QComboBox(
self, objectName="recent_combo",
toolTip="Recent files.",
activated=self.activate_recent
)
cb_append_file_list(self.recent_combo, self.recent_files)
self.recent_combo.insertSeparator(self.recent_combo.count())
self.recent_combo.addItem(u"Browse documentation data sets…")
self.browse_button = QPushButton(
u"…",
icon=icons.dir_open_icon, toolTip="Browse filesystem",
clicked=self.browse
)
self.reload_button = QPushButton(
"Reload", icon=icons.reload_icon,
toolTip="Reload the selected file", clicked=self.reload,
default=True
)
layout.addWidget(self.recent_combo, 2)
layout.addWidget(self.browse_button)
layout.addWidget(self.reload_button)
###########
# Info text
###########
box = OWGUI.widgetBox(self.controlArea, "Info", addSpace=True)
self.infoa = OWGUI.widgetLabel(box, "No data loaded.")
self.infob = OWGUI.widgetLabel(box, " ")
self.warnings = OWGUI.widgetLabel(box, " ")
# Set word wrap so long warnings won't expand the widget
self.warnings.setWordWrap(True)
self.warnings.setSizePolicy(QSizePolicy.Ignored,
QSizePolicy.MinimumExpanding)
advanced = QGroupBox(
"Advanced Settings", checkable=True, checked=self.show_advanced
)
advanced.setLayout(QVBoxLayout())
def set_group_visible(groupbox, state):
layout = groupbox.layout()
for i in range(layout.count()):
item = layout.itemAt(i)
widget = item.widget()
if widget is not None:
widget.setVisible(state)
groupbox.setFlat(not state)
def toogle_advanced(state):
self.show_advanced = state
set_group_visible(advanced, state)
self.layout().activate()
QApplication.instance().processEvents()
QTimer.singleShot(0, self.adjustSize)
advanced.toggled.connect(toogle_advanced)
self.taboptions = QWidget()
self.taboptions.setLayout(QVBoxLayout())
box = QGroupBox("Missing Value Symbols", flat=True)
form = QFormLayout(fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow)
form.addRow(
"Don't care:",
OWGUI.lineEdit(None, self, "symbol_DC",
tooltip="Default values: '~' or '*'"))
#.........这里部分代码省略.........
示例6: LeapWindow
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
#.........这里部分代码省略.........
self.minimizeAction = QAction("Mi&nimize", self,
triggered=self.hide)
self.maximizeAction = QAction("Ma&ximize", self,
triggered=self.showMaximized)
self.restoreAction = QAction("&Restore", self,
triggered=self.showNormal)
self.quitAction = QAction("&Quit", self,
triggered=self.cleanupAndQuit)
def createTrayIcon(self):
"""
creates the tray icon
"""
self.trayIconMenu = QMenu(self)
self.trayIconMenu.addAction(self.connectVPNAction)
self.trayIconMenu.addAction(self.dis_connectAction)
self.trayIconMenu.addSeparator()
self.trayIconMenu.addAction(self.minimizeAction)
self.trayIconMenu.addAction(self.maximizeAction)
self.trayIconMenu.addAction(self.restoreAction)
self.trayIconMenu.addSeparator()
self.trayIconMenu.addAction(self.quitAction)
self.trayIcon = QSystemTrayIcon(self)
self.trayIcon.setContextMenu(self.trayIconMenu)
def createLogBrowser(self):
"""
creates Browser widget for displaying logs
(in debug mode only).
"""
self.loggerBox = QGroupBox()
logging_layout = QVBoxLayout()
self.logbrowser = QTextBrowser()
startStopButton = QPushButton("&Connect")
startStopButton.clicked.connect(self.start_or_stopVPN)
self.startStopButton = startStopButton
logging_layout.addWidget(self.logbrowser)
logging_layout.addWidget(self.startStopButton)
self.loggerBox.setLayout(logging_layout)
# status box
self.statusBox = QGroupBox()
grid = QGridLayout()
self.updateTS = QLabel('')
self.status_label = QLabel('Disconnected')
self.ip_label = QLabel('')
self.remote_label = QLabel('')
tun_read_label = QLabel("tun read")
self.tun_read_bytes = QLabel("0")
tun_write_label = QLabel("tun write")
self.tun_write_bytes = QLabel("0")
grid.addWidget(self.updateTS, 0, 0)
grid.addWidget(self.status_label, 0, 1)
grid.addWidget(self.ip_label, 1, 0)
grid.addWidget(self.remote_label, 1, 1)
grid.addWidget(tun_read_label, 2, 0)
grid.addWidget(self.tun_read_bytes, 2, 1)
grid.addWidget(tun_write_label, 3, 0)
示例7: SnmpdWidget
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
class SnmpdWidget(QFrame):
def __init__(self, parent):
QFrame.__init__(self, parent)
self.parent = parent
form = QVBoxLayout(self)
title = QLabel("<H1>%s</H1>" % self.tr('SNMP Server Configuration'))
form.addWidget(title)
# Enable:
self.enable_line = QWidget()
self.enable_line.setLayout(QFormLayout())
self.enable_server = QCheckBox()
self.connect(self.enable_server, SIGNAL('stateChanged(int)'),
parent.setEnabled)
self.enable_line.layout().addRow(self.tr("Enable SNMP server"),
self.enable_server)
form.addWidget(self.enable_line)
parent.main_window.writeAccessNeeded(self.enable_server)
# V2c list (source network, community):
self.v2c_list_groupbox = QGroupBox()
self.v2c_list_groupbox.setTitle(self.tr("SNMPv2c access list"))
self.v2c_list_groupbox.setLayout(QVBoxLayout())
self.v2c_list_edit = ListEdit()
self.v2c_list_edit.headers = self.getColumnLabelsV2c()
self.v2c_list_edit.readOnly = self.parent.main_window.readonly
self.v2c_list_edit.editInPopup = True
self.v2c_list_edit.displayUpDown = False
self.v2c_list_edit.setColDelegate(self.createDelegateForColumnV2c)
self.connect(self.v2c_list_edit, SIGNAL('itemDeleted'),
self.setModified)
self.connect(self.v2c_list_edit, SIGNAL('itemAdded'),
self.setModified)
self.connect(self.v2c_list_edit, SIGNAL('itemModified'),
self.setModified)
self.v2c_list_groupbox.layout().addWidget(self.v2c_list_edit)
parent.main_window.writeAccessNeeded(self.v2c_list_edit)
form.addWidget(self.v2c_list_groupbox)
# V3 list (username, auth passphrase, auth proto, privacy key, algo):
self.v3_list_groupbox = QGroupBox()
self.v3_list_groupbox.setTitle(self.tr("SNMPv3 access list"))
self.v3_list_groupbox.setLayout(QVBoxLayout())
self.v3_list_edit = ListEdit()
self.v3_list_edit.readOnly = self.parent.main_window.readonly
self.v3_list_edit.headers = self.getColumnLabelsV3()
self.v3_list_edit.displayUpDown = False
self.v3_list_edit.editInPopup = True
self.v3_list_edit.setColDelegate(self.createDelegateForColumnV3)
self.connect(self.v3_list_edit, SIGNAL('itemDeleted'),
self.setModified)
self.connect(self.v3_list_edit, SIGNAL('itemAdded'),
self.setModified)
self.connect(self.v3_list_edit, SIGNAL('itemModified'),
self.setModified)
self.v3_list_groupbox.layout().addWidget(self.v3_list_edit)
parent.main_window.writeAccessNeeded(self.v3_list_edit)
form.addWidget(self.v3_list_groupbox)
def createDelegateForColumnV2c(self, column):
if column == INDEX_V2C_SOURCE:
return EditColumnDelegate(NetworkEdit)
return EditColumnDelegate(CommunityEdit)
def createDelegateForColumnV3(self, column):
if column == INDEX_V3_USERNAME:
return EditColumnDelegate(UsernameEdit)
elif column == INDEX_V3_AUTHENTICATION_PASS:
return PasswordColumnDelegate(PassEdit)
elif column == INDEX_V3_AUTHENTICATION_PROTO:
return ComboBoxColumnDelegate(("SHA", "MD5"))
elif column == INDEX_V3_ENCRYPTION_PASS:
return PasswordColumnDelegate(PassEdit)
elif column == INDEX_V3_ENCRYPTION_ALGO:
return ComboBoxColumnDelegate(("AES", "DES"))
return EditColumnDelegate(PassEdit)
def getColumnLabelsV2c(self):
return [self.tr("Source host or network"), self.tr("Community")]
def getColumnLabelsV3(self):
return [self.tr("Username"), self.tr("Passphrase"),
self.tr("Protocol"), self.tr("Privacy key"),
self.tr("Encrypting algorithm")]
def setModified(self, *unused):
self.parent.setModified()
示例8: __init__
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
def __init__(self, mainwin):
KDialog.__init__(self, mainwin)
self.jobs = []
self.mainwin = mainwin
self.setButtons(KDialog.ButtonCode(
KDialog.Try | KDialog.Help |
KDialog.Details | KDialog.Reset |
KDialog.Ok | KDialog.Cancel))
self.setButtonIcon(KDialog.Try, KIcon("run-lilypond"))
self.setCaption(i18n("Create blank staff paper"))
self.setHelp("blankpaper")
self.setDefaultButton(KDialog.Ok)
layout = QGridLayout(self.mainWidget())
self.typeChooser = QComboBox()
self.stack = QStackedWidget()
StackFader(self.stack)
paperSettings = QWidget(self)
paperSettings.setLayout(QHBoxLayout())
self.actionChooser = QComboBox(self)
layout.addWidget(self.typeChooser, 0, 1)
layout.addWidget(self.stack, 1, 0, 1, 3)
layout.addWidget(self.actionChooser, 2, 1)
l = QLabel(i18n("Type:"))
l.setBuddy(self.typeChooser)
layout.addWidget(l, 0, 0, Qt.AlignRight)
l = QLabel(i18n("Action:"))
l.setBuddy(self.actionChooser)
layout.addWidget(l, 2, 0, Qt.AlignRight)
# tool tips
self.typeChooser.setToolTip(i18n(
"Choose what kind of empty staves you want to create."))
self.actionChooser.setToolTip(i18n(
"Choose which action happens when clicking \"Ok\"."))
self.setButtonToolTip(KDialog.Try, i18n(
"Preview the empty staff paper."))
self.setButtonToolTip(KDialog.Details, i18n(
"Click to see more settings."))
# paper stuff
paper = QGroupBox(i18n("Paper"))
paperSettings.layout().addWidget(paper)
settings = QGroupBox(i18n("Settings"))
paperSettings.layout().addWidget(settings)
paper.setLayout(QGridLayout())
self.paperSize = QComboBox()
l = QLabel(i18n("Paper size:"))
l.setBuddy(self.paperSize)
paper.layout().addWidget(l, 0, 0, Qt.AlignRight)
paper.layout().addWidget(self.paperSize, 0, 1)
self.paperSize.addItem(i18n("Default"))
self.paperSize.addItems(ly.paperSizes)
self.staffSize = QSpinBox()
l = QLabel(i18n("Staff Size:"))
l.setBuddy(self.staffSize)
paper.layout().addWidget(l, 1, 0, Qt.AlignRight)
paper.layout().addWidget(self.staffSize, 1, 1)
self.staffSize.setRange(8, 40)
self.pageCount = QSpinBox()
l = QLabel(i18n("Page count:"))
l.setBuddy(self.pageCount)
paper.layout().addWidget(l, 2, 0, Qt.AlignRight)
paper.layout().addWidget(self.pageCount, 2, 1)
self.pageCount.setRange(1, 1000)
self.removeTagline = QCheckBox(i18n("Remove default tagline"))
paper.layout().addWidget(self.removeTagline, 3, 0, 1, 2)
settings.setLayout(QGridLayout())
self.barLines = QCheckBox(i18n("Print Bar Lines"))
self.barsPerLine = QSpinBox()
l = QLabel(i18n("Bars per line:"))
l.setBuddy(self.barsPerLine)
settings.layout().addWidget(self.barLines, 0, 0, 1, 2)
settings.layout().addWidget(l, 1, 0, Qt.AlignRight)
settings.layout().addWidget(self.barsPerLine, 1, 1)
self.barsPerLine.setRange(1, 20)
self.pageNumbers = QCheckBox(i18n("Print Page Numbers"))
self.pageNumStart = QSpinBox()
l = QLabel(i18n("Start with:"))
l.setBuddy(self.pageNumStart)
settings.layout().addWidget(self.pageNumbers, 2, 0, 1, 2)
settings.layout().addWidget(l, 3, 0, Qt.AlignRight)
settings.layout().addWidget(self.pageNumStart, 3, 1)
self.barLines.toggled.connect(self.barsPerLine.setEnabled)
self.pageNumbers.toggled.connect(self.pageNumStart.setEnabled)
# types
self.typeWidgets = [
SingleStaff(self),
PianoStaff(self),
OrganStaff(self),
ChoirStaff(self),
#.........这里部分代码省略.........
示例9: AuthenticationFrontend
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import layout [as 别名]
class AuthenticationFrontend(ScrollArea):
COMPONENT = 'auth_cert'
LABEL = tr('Authentication server')
REQUIREMENTS = ('auth_cert',)
ICON = ':/icons/auth_protocol.png'
def __init__(self, client, parent):
self.__loading = True
ScrollArea.__init__(self)
self.mainwindow = parent
self.client = client
self.modified = False
self.qauthcertobject = QAuthCertObject.getInstance()
frame = QFrame(self)
layout = QVBoxLayout(frame)
layout.addWidget(QLabel('<H1>%s</H1>' % tr('Authentication server') ))
head_box = QGroupBox(tr("How the authentication server handles certificates"))
head = QFormLayout(head_box)
self.strictCheckBox = QCheckBox()
head.addRow(QLabel(tr("Strict mode (check the client's certificate against the installed CA)")), self.strictCheckBox)
self.connect(self.strictCheckBox, SIGNAL('toggled(bool)'),
self.setStrict)
self.cl_auth_box = QGroupBox(tr("Client authentication with a certificate is"))
cl_auth = QVBoxLayout(self.cl_auth_box)
self.auth_by_cert = QButtonGroup()
self.auth_by_cert.setExclusive(True)
self.mainwindow.writeAccessNeeded(self.strictCheckBox)
labels = [tr('forbidden'), tr('allowed'), tr('mandatory')]
for index, label_button in enumerate(labels):
button = QRadioButton(label_button)
self.auth_by_cert.addButton(button, index)
cl_auth.addWidget(button)
self.mainwindow.writeAccessNeeded(button)
self.auth_by_cert.button(0).setChecked(Qt.Checked)
self.connect(self.auth_by_cert, SIGNAL('buttonClicked(int)'),
self.auth_by_cert_modified)
# Captive portal
# --------------
self.portal_groupbox = QGroupBox(tr("Captive portal"))
self.portal_groupbox.setLayout(QVBoxLayout())
# Enabled checkbox:
self.portal_checkbox = QCheckBox(tr("Enable captive portal"))
self.connect(self.portal_checkbox, SIGNAL('toggled(bool)'),
self.setPortalEnabled)
# List of networks redirected to the captive portal:
self.portal_nets_groupbox = QGroupBox(
tr("Networks handled by the captive portal"))
self.portal_nets_groupbox.setLayout(QVBoxLayout())
self.portal_nets_edit = NetworkListEdit()
self.connect(self.portal_nets_edit, SIGNAL('textChanged()'), self.setPortalNets)
self.portal_nets_groupbox.layout().addWidget(self.portal_nets_edit)
# Pack the widgets:
for widget in (self.portal_checkbox, self.portal_nets_groupbox):
self.portal_groupbox.layout().addWidget(widget)
self.mainwindow.writeAccessNeeded(self.portal_checkbox)
self.mainwindow.writeAccessNeeded(self.portal_nets_edit)
if not EDENWALL:
self.portal_groupbox.setVisible(False)
# authentication server
self.pki_widget = PkiEmbedWidget(self.client, self, 'auth_cert', PkiEmbedWidget.SHOW_ALL|PkiEmbedWidget.CRL_OPTIONAL, self.setModified)
self.mainwindow.writeAccessNeeded(self.pki_widget)
layout.addWidget(head_box)
layout.addWidget(self.cl_auth_box)
layout.addWidget(self.portal_groupbox)
layout.addWidget(self.pki_widget)
layout.addStretch()
self.setWidget(frame)
self.setWidgetResizable(True)
self.resetConf()
self.__loading = False
def setModified(self, isModified=True, message=""):
if self.__loading:
return
if isModified:
self.modified = True
self.mainwindow.setModified(self, True)
if message:
self.mainwindow.addToInfoArea(message)
else:
self.modified = False
#.........这里部分代码省略.........