本文整理汇总了Python中PyQt4.QtGui.QGroupBox.setSizePolicy方法的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox.setSizePolicy方法的具体用法?Python QGroupBox.setSizePolicy怎么用?Python QGroupBox.setSizePolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGroupBox
的用法示例。
在下文中一共展示了QGroupBox.setSizePolicy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _drawButtons
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
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)
示例2: __getIDEWideGroupbox
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __getIDEWideGroupbox( self ):
" Creates the IDE wide groupbox "
ideGroupbox = QGroupBox( self )
ideGroupbox.setTitle( "IDE Wide Settings" )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
ideGroupbox.sizePolicy().hasHeightForWidth() )
ideGroupbox.setSizePolicy( sizePolicy )
layoutIDE = QHBoxLayout( ideGroupbox )
termGroupbox = self.__getTermGroupbox()
termGroupbox.setTitle( "Terminal to run in" )
layoutIDE.addWidget( termGroupbox )
if self.__action == "profile":
# Profile version of the dialog
limitsGroupbox = self.__getProfileLimitsGroupbox()
layoutIDE.addWidget( limitsGroupbox )
else:
# Debug version of the dialog
dbgGroupbox = self.__getDebugGroupbox()
layoutIDE.addWidget( dbgGroupbox )
return ideGroupbox
示例3: __init__
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __init__(self, *args, **kwargs):
# Initialize the base class...
super(DvidDataSelectionBrowser, self).__init__(*args, **kwargs)
self._subvol_widget = SubregionRoiWidget(parent=self)
subvol_layout = QVBoxLayout()
subvol_layout.addWidget(self._subvol_widget)
group_title = (
"Restrict to subvolume (Right-click a volume name above to auto-initialize these subvolume parameters.)"
)
subvol_groupbox = QGroupBox(group_title, parent=self)
subvol_groupbox.setCheckable(True)
subvol_groupbox.setChecked(False)
subvol_groupbox.setEnabled(False)
subvol_groupbox.toggled.connect(self._update_status)
subvol_groupbox.setLayout(subvol_layout)
subvol_groupbox.setFixedHeight(200)
subvol_groupbox.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum)
self._subvol_groupbox = subvol_groupbox
# Add to the layout
layout = self.layout()
layout.insertWidget(3, subvol_groupbox)
# Special right-click behavior.
self._repo_treewidget.viewport().installEventFilter(self)
示例4: __getProfileLimitsGroupbox
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __getProfileLimitsGroupbox( self ):
" Creates the profile limits groupbox "
limitsGroupbox = QGroupBox( self )
limitsGroupbox.setTitle( "Profiler diagram limits" )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
limitsGroupbox.sizePolicy().hasHeightForWidth() )
limitsGroupbox.setSizePolicy( sizePolicy )
layoutLimits = QGridLayout( limitsGroupbox )
self.__nodeLimitEdit = QLineEdit()
self.__nodeLimitEdit.textEdited.connect( self.__setRunButtonProps )
self.__nodeLimitValidator = QDoubleValidator( 0.0, 100.0, 2, self )
self.__nodeLimitValidator.setNotation( QDoubleValidator.StandardNotation )
self.__nodeLimitEdit.setValidator( self.__nodeLimitValidator )
nodeLimitLabel = QLabel( "Hide nodes below" )
self.__edgeLimitEdit = QLineEdit()
self.__edgeLimitEdit.textEdited.connect( self.__setRunButtonProps )
self.__edgeLimitValidator = QDoubleValidator( 0.0, 100.0, 2, self )
self.__edgeLimitValidator.setNotation( QDoubleValidator.StandardNotation )
self.__edgeLimitEdit.setValidator( self.__edgeLimitValidator )
edgeLimitLabel = QLabel( "Hide edges below" )
layoutLimits.addWidget( nodeLimitLabel, 0, 0 )
layoutLimits.addWidget( self.__nodeLimitEdit, 0, 1 )
layoutLimits.addWidget( QLabel( "%" ), 0, 2 )
layoutLimits.addWidget( edgeLimitLabel, 1, 0 )
layoutLimits.addWidget( self.__edgeLimitEdit, 1, 1 )
layoutLimits.addWidget( QLabel( "%" ), 1, 2 )
return limitsGroupbox
示例5: __getDebugGroupbox
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __getDebugGroupbox( self ):
" Creates the debug settings groupbox "
dbgGroupbox = QGroupBox( self )
dbgGroupbox.setTitle( "Debugger" )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
dbgGroupbox.sizePolicy().hasHeightForWidth() )
dbgGroupbox.setSizePolicy( sizePolicy )
dbgLayout = QVBoxLayout( dbgGroupbox )
self.__reportExceptionCheckBox = QCheckBox( "Report &exceptions" )
self.__reportExceptionCheckBox.stateChanged.connect(
self.__onReportExceptionChanged )
self.__traceInterpreterCheckBox = QCheckBox( "T&race interpreter libs" )
self.__traceInterpreterCheckBox.stateChanged.connect(
self.__onTraceInterpreterChanged )
self.__stopAtFirstCheckBox = QCheckBox( "Stop at first &line" )
self.__stopAtFirstCheckBox.stateChanged.connect(
self.__onStopAtFirstChanged )
self.__autoforkCheckBox = QCheckBox( "&Fork without asking" )
self.__autoforkCheckBox.stateChanged.connect(self.__onAutoforkChanged )
self.__debugChildCheckBox = QCheckBox( "Debu&g child process" )
self.__debugChildCheckBox.stateChanged.connect( self.__onDebugChild )
dbgLayout.addWidget( self.__reportExceptionCheckBox )
dbgLayout.addWidget( self.__traceInterpreterCheckBox )
dbgLayout.addWidget( self.__stopAtFirstCheckBox )
dbgLayout.addWidget( self.__autoforkCheckBox )
dbgLayout.addWidget( self.__debugChildCheckBox )
return dbgGroupbox
示例6: initAppletDrawerUi
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
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)
示例7: __getTermGroupbox
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
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__
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __init__(self, *args, **kwargs):
# Initialize the base class...
super( DvidDataSelectionBrowser, self ).__init__(*args, **kwargs)
self._roi_widget = SubregionRoiWidget( parent=self )
roi_layout = QVBoxLayout()
roi_layout.addWidget( self._roi_widget )
roi_groupbox = QGroupBox("Specify Region of Interest", parent=self)
roi_groupbox.setCheckable(True)
roi_groupbox.setChecked(False)
roi_groupbox.setEnabled(False)
roi_groupbox.toggled.connect( self._update_display )
roi_groupbox.setLayout( roi_layout )
roi_groupbox.setFixedHeight( 200 )
roi_groupbox.setSizePolicy( QSizePolicy.Preferred, QSizePolicy.Minimum )
self._roi_groupbox = roi_groupbox
# Add to the layout
layout = self.layout()
layout.insertWidget( 3, roi_groupbox )
示例9: __createLayout
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __createLayout( self ):
""" Creates the dialog layout """
self.resize( 450, 150 )
self.setSizeGripEnabled( True )
verticalLayout = QVBoxLayout( self )
whereGroupbox = QGroupBox( self )
whereGroupbox.setTitle( "Garbage collector message destination" )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
whereGroupbox.sizePolicy().hasHeightForWidth() )
whereGroupbox.setSizePolicy( sizePolicy )
layoutWhere = QVBoxLayout( whereGroupbox )
self.__silentRButton = QRadioButton( whereGroupbox )
self.__silentRButton.setText( "Silent" )
layoutWhere.addWidget( self.__silentRButton )
self.__statusbarRButton = QRadioButton( whereGroupbox )
self.__statusbarRButton.setText( "Status bar" )
layoutWhere.addWidget( self.__statusbarRButton )
self.__logtabRButton = QRadioButton( whereGroupbox )
self.__logtabRButton.setText( "Log tab" )
layoutWhere.addWidget( self.__logtabRButton )
verticalLayout.addWidget( whereGroupbox )
buttonBox = QDialogButtonBox( self )
buttonBox.setOrientation( Qt.Horizontal )
buttonBox.setStandardButtons( QDialogButtonBox.Ok |
QDialogButtonBox.Cancel )
self.__OKButton = buttonBox.button( QDialogButtonBox.Ok )
self.__OKButton.setDefault( True )
buttonBox.accepted.connect( self.accept )
buttonBox.rejected.connect( self.close )
verticalLayout.addWidget( buttonBox )
return
示例10: _create_files_box
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def _create_files_box(self):
box = QGroupBox(self.FILES_BOX_TEXT, self)
box.setSizePolicy(QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding))
self._files_display = FilesDisplay(box)
self._files_display_summary = FilesDisplaySummaryPanel(box)
self._files_display.request_add_override.connect(self.request_add_override)
self._files_display.request_remove_override.connect(self.request_remove_override)
self._files_display.counts_changed.connect(self._files_display_summary.set_counts)
self._files_display.is_browsing_category_changed.connect(self._files_display_summary.set_is_browsing_category)
self._files_display.has_next_in_category_changed.connect(self._files_display_summary.set_has_next_in_category)
self._files_display.has_prev_in_category_changed.connect(self._files_display_summary.set_has_prev_in_category)
self._files_display_summary.start_browsing_category.connect(self._files_display.start_browsing_category)
self._files_display_summary.next_in_category.connect(self._files_display.next_in_category)
self._files_display_summary.prev_in_category.connect(self._files_display.prev_in_category)
layout = QVBoxLayout(box)
layout.addWidget(self._files_display)
layout.addWidget(self._files_display_summary)
return box
示例11: __createLayout
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __createLayout( self ):
" Creates the dialog layout "
self.resize( 640, 480 )
self.setSizeGripEnabled( True )
vboxLayout = QVBoxLayout( self )
# Revisions to compare
compareGroupbox = QGroupBox( self )
compareGroupbox.setTitle( "Revisions to compare" )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
compareGroupbox.sizePolicy().hasHeightForWidth() )
compareGroupbox.setSizePolicy( sizePolicy )
revisionLayout = QHBoxLayout( compareGroupbox )
self.__lhsRevisionLabel = QLabel()
self.__lhsRevisionLabel.setFrameStyle( QFrame.StyledPanel )
self.__lhsResetButton = QToolButton()
self.__lhsResetButton.setIcon( PixmapCache().getIcon( pluginHomeDir + 'svnclearrev.png' ) )
self.__lhsResetButton.setFocusPolicy( Qt.NoFocus )
self.__lhsResetButton.setEnabled( False )
self.__lhsResetButton.setToolTip( "Reset revision to compare" )
self.__lhsResetButton.clicked.connect( self.__onLHSReset )
self.__rhsRevisionLabel = QLabel()
self.__rhsRevisionLabel.setFrameStyle( QFrame.StyledPanel )
self.__rhsResetButton = QToolButton()
self.__rhsResetButton.setIcon( PixmapCache().getIcon( pluginHomeDir + 'svnclearrev.png' ) )
self.__rhsResetButton.setFocusPolicy( Qt.NoFocus )
self.__rhsResetButton.setEnabled( False )
self.__rhsResetButton.setToolTip( "Reset revision to compare" )
self.__rhsResetButton.clicked.connect( self.__onRHSReset )
lhsLayout = QHBoxLayout()
lhsLayout.addWidget( self.__lhsRevisionLabel )
lhsLayout.addWidget( self.__lhsResetButton )
rhsLayout = QHBoxLayout()
rhsLayout.addWidget( self.__rhsRevisionLabel )
rhsLayout.addWidget( self.__rhsResetButton )
bothLayout = QVBoxLayout()
bothLayout.addLayout( lhsLayout )
bothLayout.addLayout( rhsLayout )
revisionLayout.addLayout( bothLayout )
self.__diffButton = QToolButton()
self.__diffButton.setText( "Diff" )
self.__diffButton.setFocusPolicy( Qt.NoFocus )
self.__diffButton.setEnabled( False )
self.__diffButton.clicked.connect( self.__onDiff )
revisionLayout.addWidget( self.__diffButton )
vboxLayout.addWidget( compareGroupbox )
# Log table
logHeaderFrame = QFrame()
logHeaderFrame.setFrameStyle( QFrame.StyledPanel )
logHeaderFrame.setAutoFillBackground( True )
self.__setLightPalette( logHeaderFrame )
logHeaderFrame.setFixedHeight( 24 )
logHeaderLayout = QHBoxLayout()
logHeaderLayout.setContentsMargins( 3, 0, 0, 0 )
logHeaderLayout.addWidget( QLabel( "Subversion log of " + self.__path ) )
logHeaderFrame.setLayout( logHeaderLayout )
vboxLayout.addWidget( logHeaderFrame )
self.__logView = QTreeWidget()
self.__logView.setAlternatingRowColors( True )
self.__logView.setRootIsDecorated( False )
self.__logView.setItemsExpandable( False )
self.__logView.setSortingEnabled( True )
self.__logView.setItemDelegate( NoOutlineHeightDelegate( 4 ) )
self.__logViewHeader = QTreeWidgetItem( [ "", "", "Revision", "Date",
"Author", "Message" ] )
self.__logView.setHeaderItem( self.__logViewHeader )
self.__logView.header().setSortIndicator( REVISION_COL, Qt.AscendingOrder )
self.__logView.itemChanged.connect( self.__onLogViewChanged )
vboxLayout.addWidget( self.__logView )
# Diff part
diffHeaderFrame = QFrame()
diffHeaderFrame.setFrameStyle( QFrame.StyledPanel )
diffHeaderFrame.setAutoFillBackground( True )
self.__setLightPalette( diffHeaderFrame )
diffHeaderFrame.setFixedHeight( 24 )
diffLabel = QLabel( "Diff" )
diffExpandingSpacer = QSpacerItem( 10, 10, QSizePolicy.Expanding )
self.__showHideDiffButton = QToolButton()
self.__showHideDiffButton.setAutoRaise( True )
self.__showHideDiffButton.setIcon( PixmapCache().getIcon( 'less.png' ) )
self.__showHideDiffButton.setFixedSize( 20, 20 )
self.__showHideDiffButton.setToolTip( "Show diff" )
self.__showHideDiffButton.setFocusPolicy( Qt.NoFocus )
self.__showHideDiffButton.clicked.connect( self.__onShowHideDiff )
#.........这里部分代码省略.........
示例12: __createProjectSpecific
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __createProjectSpecific( self ):
" Creates the project specific part "
widget = QWidget()
verticalLayout = QVBoxLayout( widget )
infoLabel = QLabel( "Note: the settings below are used "
"only for the specific project." )
verticalLayout.addWidget( infoLabel )
# Authorization group box
authGroupbox = QGroupBox( self )
authGroupbox.setTitle( "Authorization" )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
authGroupbox.sizePolicy().hasHeightForWidth() )
authGroupbox.setSizePolicy( sizePolicy )
layoutAuth = QVBoxLayout( authGroupbox )
self.__projectAuthExtRButton = QRadioButton( "External", authGroupbox )
self.__projectAuthExtRButton.clicked.connect( self.__projectAuthChanged )
layoutAuth.addWidget( self.__projectAuthExtRButton )
self.__projectAuthPasswdRButton = QRadioButton(
"Use user name / password", authGroupbox )
self.__projectAuthPasswdRButton.clicked.connect( self.__projectAuthChanged )
layoutAuth.addWidget( self.__projectAuthPasswdRButton )
upLayout = QGridLayout()
self.__projectUser = QLineEdit()
self.__projectUser.setToolTip( "Attention: user name is "
"saved unencrypted" )
self.__projectPasswd = QLineEdit()
self.__projectPasswd.setToolTip( "Attention: password is "
"saved unencrypted" )
spacer = QWidget()
spacer.setFixedWidth( 16 )
upLayout.addWidget( spacer, 0, 0 )
upLayout.addWidget( QLabel( "User name" ), 0, 1 )
upLayout.addWidget( self.__projectUser, 0, 2 )
upLayout.addWidget( QLabel( "Password" ), 1, 1 )
upLayout.addWidget( self.__projectPasswd, 1, 2 )
layoutAuth.addLayout( upLayout )
# Update status group box
updateGroupbox = QGroupBox( self )
updateGroupbox.setTitle( "Update status policy" )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth(
updateGroupbox.sizePolicy().hasHeightForWidth() )
updateGroupbox.setSizePolicy( sizePolicy )
layoutUpdate = QVBoxLayout( updateGroupbox )
self.__projectReposRButton = QRadioButton( "Check repository",
updateGroupbox )
layoutUpdate.addWidget( self.__projectReposRButton )
self.__projectLocalRButton = QRadioButton( "Local only",
updateGroupbox )
layoutUpdate.addWidget( self.__projectLocalRButton )
verticalLayout.addWidget( authGroupbox )
verticalLayout.addWidget( updateGroupbox )
return widget
示例13: MyForm
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
#.........这里部分代码省略.........
self.connect(self.actionEditSource, SIGNAL("triggered()"), lambda: self.edit_file(path=sys.argv[0], editor=EDITOR))
self.connect(self.actionQuit, SIGNAL("triggered()"), self.close)
self.connect(self.actionAbout, SIGNAL("triggered()"), lambda: QMessageBox.about(self, 'About %s' % APPNAME,
'''
<h4>%s version %s</h4>
<p>
Created by <i>%s</i></p>
<p><a href="mailto:%s">%s</a></p>
<p><a href="%s">chanchantv.googlecode.com</a></p>
''' % (APPNAME, VERSION, AUTHOR, EMAIL.decode('base64'), EMAIL, WEB)) # warning(self, APPNAME, 'No playlist selected')
)
# self.listbox.connect(self.listbox, SIGNAL("customContextMenuRequested(QPoint)"),
# self.on_right_click)
# self.txtChanInfo = QLineEdit()
# self.txtChanInfo.setReadOnly(True)
# self.logWindow = QTextEdit()
# self.logWindow.setSizePolicyx(QSizePolicy.)
self.status = QLabel()
self.status.setText('channels')
# ADD BEVELED BORDER::self.status.setFrameStyle(QFrame.Panel | QFrame.Sunken)
self.groupBox = QGroupBox("Engine")
sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
self.groupBox.setSizePolicy(sizePolicy)
# self.groupBox.setAutoFillBackground(True)
self.rbMplayer = QRadioButton('&Mplayer', self.groupBox)
self.rbMplayer.setChecked(True)
self.rbMplayer.setToolTip("Play with Mplayer")
#self.rbGstreamer = QRadioButton('gst&123', self.groupBox)
self.rbVlc = QRadioButton('&Vlc', self.groupBox)
self.rbVlc.setToolTip("Play with VLC")
self.rbTotem = QRadioButton('&Totem', self.groupBox)
self.rbTotem.setToolTip("Play with Totem")
self.rbBrowser = QRadioButton('&Browser', self.groupBox)
self.rbBrowser.setToolTip("Open URL in web browser")
self.hBoxTop = QHBoxLayout()
self.hBoxTop.addWidget(self.rbMplayer)
#self.hBoxTop.addWidget(self.rbGstreamer)
self.hBoxTop.addWidget(self.rbVlc)
self.hBoxTop.addWidget(self.rbTotem)
self.hBoxTop.addWidget(self.rbBrowser)
self.groupBox.setLayout(self.hBoxTop)
self.cbPlaylistFlag = QCheckBox('Playlist')
self.cbPlaylistFlag.setToolTip('Resource is a M3U, ASX or PLS playlist')
self.cbFullScreen = QCheckBox('Full Screen')
self.cbFullScreen.setToolTip('Start video in full screen')
self.cbFullScreen.setChecked(self.is_full_screen)
self.cbInhibitScreensaver = QCheckBox('Inhibit Screensaver')
self.cbInhibitScreensaver.setToolTip('Disable screensaver while playing stream')
self.cbInhibitScreensaver.setChecked(self.is_inhibit_screen)
# addWidget(widget, row, column, rowSpan, columnSpan)
grid.addWidget(self.groupBox, 0, 0, 1, 3)
grid.addWidget(btn_play, 0, 4, 1, 1)
示例14: __createLayout
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def __createLayout( self ):
" Creates the dialog layout "
self.resize( 640, 480 )
self.setSizeGripEnabled( True )
vboxLayout = QVBoxLayout( self )
hLayout = QHBoxLayout()
self.__propsView = QTreeWidget()
self.__propsView.setAlternatingRowColors( True )
self.__propsView.setRootIsDecorated( False )
self.__propsView.setItemsExpandable( False )
self.__propsView.setSortingEnabled( True )
self.__propsView.setItemDelegate( NoOutlineHeightDelegate( 4 ) )
self.__propsView.itemSelectionChanged.connect( self.__propsSelectionChanged )
propsViewHeader = QTreeWidgetItem( [ "Property Name", "Property Value" ] )
self.__propsView.setHeaderItem( propsViewHeader )
self.__propsView.header().setSortIndicator( 0, Qt.DescendingOrder )
hLayout.addWidget( self.__propsView )
self.__delButton = QToolButton()
self.__delButton.setText( "Delete" )
self.__delButton.setFocusPolicy( Qt.NoFocus )
self.__delButton.setEnabled( False )
self.__delButton.clicked.connect( self.__onDel )
hLayout.addWidget( self.__delButton, 0, Qt.AlignBottom )
vboxLayout.addLayout( hLayout )
# Set property part
setGroupbox = QGroupBox( self )
setGroupbox.setTitle( "Set Property" )
setLayout = QGridLayout( setGroupbox )
setLayout.addWidget( QLabel( "Name" ), 0, 0, Qt.AlignTop | Qt.AlignRight )
setLayout.addWidget( QLabel( "Value" ), 1, 0, Qt.AlignTop | Qt.AlignRight )
self.__nameEdit = QLineEdit()
self.__nameEdit.textChanged.connect( self.__nameChanged )
setLayout.addWidget( self.__nameEdit, 0, 1 )
self.__valueEdit = QTextEdit()
self.__valueEdit.setAcceptRichText( False )
self.__valueEdit.textChanged.connect( self.__valueChanged )
metrics = QFontMetrics( self.__valueEdit.font() )
rect = metrics.boundingRect( "X" )
self.__valueEdit.setFixedHeight( rect.height() * 4 + 5 )
setLayout.addWidget( self.__valueEdit, 1, 1 )
self.__setButton = QToolButton()
self.__setButton.setText( "Set" )
self.__setButton.setFocusPolicy( Qt.NoFocus )
self.__setButton.setEnabled( False )
self.__setButton.clicked.connect( self.__onSet )
setLayout.addWidget( self.__setButton, 1, 2, Qt.AlignBottom | Qt.AlignHCenter )
sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Maximum )
sizePolicy.setHorizontalStretch( 0 )
sizePolicy.setVerticalStretch( 0 )
sizePolicy.setHeightForWidth( setGroupbox.sizePolicy().hasHeightForWidth() )
setGroupbox.setSizePolicy( sizePolicy )
vboxLayout.addWidget( setGroupbox )
# Buttons at the bottom
buttonBox = QDialogButtonBox( self )
buttonBox.setOrientation( Qt.Horizontal )
buttonBox.setStandardButtons( QDialogButtonBox.Ok )
buttonBox.button( QDialogButtonBox.Ok ).setDefault( True )
buttonBox.accepted.connect( self.close )
vboxLayout.addWidget( buttonBox )
return
示例15: _init_layout
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setSizePolicy [as 别名]
def _init_layout(self):
"""
Create the GUI widgets (but leave them empty).
"""
hostname_combobox = QComboBox(parent=self)
self._hostname_combobox = hostname_combobox
hostname_combobox.setEditable(True)
hostname_combobox.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Maximum )
hostname_combobox.installEventFilter(self)
for hostname in self._suggested_hostnames:
hostname_combobox.addItem( hostname )
self._connect_button = QPushButton("Connect", parent=self, clicked=self._handle_new_hostname)
hostname_layout = QHBoxLayout()
hostname_layout.addWidget( hostname_combobox )
hostname_layout.addWidget( self._connect_button )
hostname_groupbox = QGroupBox("DVID Host", parent=self)
hostname_groupbox.setLayout( hostname_layout )
hostname_groupbox.setSizePolicy( QSizePolicy.Preferred, QSizePolicy.Maximum )
data_treewidget = QTreeWidget(parent=self)
data_treewidget.setHeaderLabels( ["Data"] ) # TODO: Add type, shape, axes, etc.
data_treewidget.setSizePolicy( QSizePolicy.Preferred, QSizePolicy.Preferred )
data_treewidget.itemSelectionChanged.connect( self._handle_data_selection )
data_layout = QVBoxLayout()
data_layout.addWidget( data_treewidget )
data_groupbox = QGroupBox("Data Volumes", parent=self)
data_groupbox.setLayout( data_layout )
node_listwidget = QListWidget(parent=self)
node_listwidget.setSizePolicy( QSizePolicy.Preferred, QSizePolicy.Preferred )
node_listwidget.itemSelectionChanged.connect( self._update_display )
node_layout = QVBoxLayout()
node_layout.addWidget( node_listwidget )
node_groupbox = QGroupBox("Nodes", parent=self)
node_groupbox.setLayout( node_layout )
new_data_edit = QLineEdit(parent=self)
new_data_edit.textEdited.connect( self._update_display )
full_url_label = QLabel(parent=self)
full_url_label.setSizePolicy( QSizePolicy.Preferred, QSizePolicy.Maximum )
text_flags = full_url_label.textInteractionFlags()
full_url_label.setTextInteractionFlags( text_flags | Qt.TextSelectableByMouse )
new_data_layout = QVBoxLayout()
new_data_layout.addWidget( new_data_edit )
new_data_groupbox = QGroupBox("New Data Volume", parent=self)
new_data_groupbox.setLayout( new_data_layout )
new_data_groupbox.setSizePolicy( QSizePolicy.Preferred, QSizePolicy.Maximum )
buttonbox = QDialogButtonBox( Qt.Horizontal, parent=self )
buttonbox.setStandardButtons( QDialogButtonBox.Ok | QDialogButtonBox.Cancel )
buttonbox.accepted.connect( self.accept )
buttonbox.rejected.connect( self.reject )
buttonbox.button(QDialogButtonBox.Ok).setEnabled(False)
layout = QVBoxLayout()
layout.addWidget( hostname_groupbox )
layout.addWidget( data_groupbox )
layout.addWidget( node_groupbox )
if self._mode == "specify_new":
layout.addWidget( new_data_groupbox )
else:
new_data_groupbox.hide()
layout.addWidget( full_url_label )
layout.addWidget( buttonbox )
# Stretch factors
layout.setStretchFactor(data_groupbox, 3)
layout.setStretchFactor(node_groupbox, 1)
self.setLayout(layout)
self.setWindowTitle( "Select DVID Volume" )
# Initially disabled
data_groupbox.setEnabled(False)
node_groupbox.setEnabled(False)
new_data_groupbox.setEnabled(False)
# Save instance members
self._data_groupbox = data_groupbox
self._node_groupbox = node_groupbox
self._new_data_groupbox = new_data_groupbox
self._data_treewidget = data_treewidget
self._node_listwidget = node_listwidget
self._new_data_edit = new_data_edit
self._full_url_label = full_url_label
self._buttonbox = buttonbox