本文整理汇总了Python中PyQt4.QtGui.QGroupBox.show方法的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox.show方法的具体用法?Python QGroupBox.show怎么用?Python QGroupBox.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGroupBox
的用法示例。
在下文中一共展示了QGroupBox.show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Mplayer
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import show [as 别名]
#.........这里部分代码省略.........
self.setLayout(mhbox)
#=== connexion des widgets à des fonctions ===#
if Mplayer.REVENIR in choixWidget:
self.connect(self.bout_revenir, SIGNAL('clicked()'), SLOT('close()'))
if Mplayer.PARCOURIR in choixWidget:
self.connect(self.bout_ouvVideo, SIGNAL('clicked()'), self.ouvrirVideo)
if Mplayer.PRECEDENT_SUIVANT in choixWidget:
self.connect(self.bout_prec, SIGNAL('clicked()'), self.precedent)
self.connect(self.bout_suivant, SIGNAL('clicked()'), self.suivant)
#Ajouté le 08/11/2009 - Liste des fichiers dans une combobox
if self.LISTW :
self.connect(self.listFichiers, SIGNAL('currentIndexChanged(int)'), self.changeVideo)
self.connect(self.bout_LectPause, SIGNAL('clicked()'), self.lectPause)
self.connect(self.bout_Arret, SIGNAL('clicked()'), self.arretMPlayer)
self.connect(self.mplayerProcess, SIGNAL('readyReadStandardOutput()'), self.recupSortie)
self.connect(self.mplayerProcess, SIGNAL('finished(int,QProcess::ExitStatus)'), self.finVideo)
self.connect(self.timer, SIGNAL('timeout()'), self.sonderTempsActuel)
self.connect(self.slider, SIGNAL('sliderMoved(int)'), self.changerTempsCurseur)
self.connect(self.cibleVideo, SIGNAL('changeSize'), self.sizeMplayer)
if Mplayer.RATIO in choixWidget :
self.connect(self.choicenorm, SIGNAL("clicked(bool)"), self.defRatio)
self.connect(self.choicewide, SIGNAL("clicked(bool)"), self.defRatio)
self.connect(self.choiceone, SIGNAL("clicked(bool)"), self.defRatio)
def setListeVideo(self) :
self.referenceVideo = []
self.listFichiers.clear()
for vid in self.listeVideos :
self.referenceVideo.append(vid)
self.listFichiers.addItem(os.path.basename(vid))
if self.listeVideos.__len__() > 1 :
self.listFichiers.show()
def setAudio(self,au) :
if au :
self.cibleVideo.hide()
if "conf" in self.__dict__ :
self.conf.hide()
else :
self.cibleVideo.show()
if "conf" in self.__dict__ :
self.conf.show()
def changeVideo(self, index) :
self.arretMPlayer()
if index >= 0 : # Condition ajoutée pour éviter une erreure de dépassement de range dans la liste.
self.listeVideos = self.referenceVideo[index]
self.listFichiers.setCurrentIndex(index)
def defRatio(self, state=0) :
if state :
if self.choicenorm.isChecked() :
self.setRatio(4.0/3.0)
if self.choicewide.isChecked() :
self.setRatio(16.0/9.0)
if self.choiceone.isChecked() :
try :
dim=getVideoSize(unicode(self.listeVideos[0]))
self.setRatio(dim[0]/dim[1])
except :
None
self.defRatio()
else :
self.adjustSize()
示例2: PluginWidget
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import show [as 别名]
class PluginWidget(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.pluginMetadata = {}
# Main layout
self.mainLayout = QVBoxLayout()
self.setLayout(self.mainLayout)
# Define size used for the underlines
self.underlineSize = QSize()
self.underlineSize.setHeight(1)
# Define font used for headers
self.font = QFont()
self.font.setPointSize(11)
self.font.setBold(True)
self.font.setUnderline(True)
# Plugins Description
self.pluginDescription = QLabel()
self.pluginDescription.setText("Click a plugin to see more information." +
" Plugins can be configured from the Recording tab. \n")
self.pluginDescription.setWordWrap(True)
# Plugins GroupBox
self.pluginLayout = QVBoxLayout()
self.pluginGroupBox = QGroupBox("Plugins extend the functionality of Freeseer")
self.pluginGroupBox.setLayout(self.pluginLayout)
self.pluginLayout.insertWidget(0, self.pluginDescription)
self.mainLayout.insertWidget(0, self.pluginGroupBox)
# Plugins list
self.list = QTreeWidget()
self.list.setHeaderHidden(True)
self.list.headerItem().setText(0, "1")
self.pluginLayout.insertWidget(1, self.list)
# Details
self.detailPane = QGroupBox()
self.detailLayout = QVBoxLayout()
self.detailPane.setLayout(self.detailLayout)
self.detailPaneDesc = QLabel()
self.detailPaneDesc.setWordWrap(True)
self.detailLayout.addWidget(self.detailPaneDesc)
self.pluginLayout.insertWidget(2, self.detailPane)
self.list.itemSelectionChanged.connect(self.treeViewSelect)
def treeViewSelect(self):
item = self.list.currentItem()
key = str(item.text(0))
if key in self.pluginMetadata.keys():
self.showDetails(key)
else:
self.hideDetails()
def showDetails(self, key):
self.detailPane.setTitle(key)
self.detailPaneDesc.setText(self.pluginMetadata[key])
self.detailPane.show()
def hideDetails(self):
self.detailPane.hide()
def getWidgetPlugin(self, plugin, plugin_category, plugman):
plugin_name = plugin.plugin_object.get_name()
item = QTreeWidgetItem()
# Display Plugin's meta data in a tooltip
pluginDetails = """
<table>
<tr>
<td>Name: </td>
<td><b>%(name)s</b></td>
</tr>
<tr>
<td>Version: </td>
<td><b>%(version)s</b></td>
<tr>
<td>Author: </td>
<td><b>%(author)s</b></td>
</tr>
<tr>
<td>Website: </td>
<td><b>%(website)s</b></td>
</tr>
<tr>
<td>Description: </td>
<td><b>%(description)s</b></td>
</tr>
</table>
""" % {"name": plugin.name,
"version": plugin.version,
"author": plugin.author,
"website": plugin.website,
"description": plugin.description}
#.........这里部分代码省略.........
示例3: AdvancedVisualizationForm
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import show [as 别名]
#.........这里部分代码省略.........
def on_co_result_style_changed(self, ind):
available_viz_types = [
'Table (per year, spans indicators)',
'Chart (per indicator, spans years)',
'Map (per indicator per year)',
'Chart (per indicator, spans years)',
]
available_export_types = [
'ESRI table (for loading in ArcGIS)'
]
txt = self.co_result_style.currentText()
if txt == 'visualize':
available_types = available_viz_types
else:
available_types = available_export_types
self.co_result_type.clear()
for result_type in available_types:
r_type = QString(result_type)
self.co_result_type.addItem(r_type)
def on_co_result_type_changed(self, ind):
self.gridlayout3.removeWidget(self.le_esri_storage_location)
self.gridlayout3.removeWidget(self.pbn_set_esri_storage_location)
self.optionsGroupBox.hide()
self.pbn_set_esri_storage_location.hide()
self.le_esri_storage_location.hide()
txt = self.co_result_type.currentText()
print txt
if txt == 'ESRI table (for loading in ArcGIS)':
self.pbn_set_esri_storage_location.show()
self.le_esri_storage_location.show()
self.gridlayout3.addWidget(self.le_esri_storage_location,0,1,1,6)
self.gridlayout3.addWidget(self.pbn_set_esri_storage_location,0,7,1,1)
self.optionsGroupBox.show()
def on_pbn_set_esri_storage_location_released(self):
print 'pbn_set_esri_storage_location released'
from opus_core.misc import directory_path_from_opus_path
start_dir = directory_path_from_opus_path('opus_gui.projects')
configDialog = QFileDialog()
filter_str = QString("*.gdb")
fd = configDialog.getExistingDirectory(self,QString("Please select an ESRI geodatabase (*.gdb)..."), #, *.sde, *.mdb)..."),
QString(start_dir), QFileDialog.ShowDirsOnly)
if len(fd) != 0:
fileName = QString(fd)
fileNameInfo = QFileInfo(QString(fd))
fileNameBaseName = fileNameInfo.completeBaseName()
self.le_esri_storage_location.setText(fileName)
def on_pbn_go_released(self):
# Fire up a new thread and run the model
print 'Go button pressed'
# References to the GUI elements for status for this run...
#self.statusLabel = self.runStatusLabel
#self.statusLabel.setText(QString('Model initializing...'))
indicator_names = []
for i in range(self.lw_indicators.count()):
indicator_names.append(str(self.lw_indicators.item(i).text()))
if indicator_names == []:
print 'no indicators selected'
return
indicator_type = str(self.co_result_type.currentText())
indicator_type = {
#'Map (per indicator per year)':'matplotlib_map',
'Map (per indicator per year)':'mapnik_map',
'Chart (per indicator, spans years)':'matplotlib_chart',
'Table (per indicator, spans years)':'table_per_attribute',
'Table (per year, spans indicators)':'table_per_year',
'ESRI table (for loading in ArcGIS)':'table_esri'
}[indicator_type]
kwargs = {}
if indicator_type == 'table_esri':
storage_location = str(self.le_esri_storage_location.text())
if not os.path.exists(storage_location):
print 'Warning: %s does not exist!!'%storage_location
kwargs['storage_location'] = storage_location
self.result_manager.addIndicatorForm(indicator_type = indicator_type,
indicator_names = indicator_names,
kwargs = kwargs)
def runUpdateLog(self):
self.logFileKey = self.result_generator._get_current_log(self.logFileKey)
def runErrorFromThread(self,errorMessage):
QMessageBox.warning(self.mainwindow, 'Warning', errorMessage)
示例4: urlgroup
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import show [as 别名]
class urlgroup(QGroupBox):
def __init__(self, parent=None):
super(urlgroup, self).__init__(parent)
self.setGeometry(10,30,500,80)
self.setObjectName('urlgroup')
self.urlbar = QLineEdit()
self.urlbar.setObjectName('urlbar')
self.urlbar.setText('Collez votre URL içi')
self.urlbar.setStyleSheet('font-weight:lighter;color:gray;')
self.urlbar.show()
self.parsebutton = QPushButton('Go !!')
self.parsebutton.setObjectName('parsebutton')
self.parsebutton.show()
layout = QBoxLayout(QBoxLayout.LeftToRight, self)
layout.addWidget(self.urlbar)
layout.addWidget(self.parsebutton)
self.show()
self.group2 = QGroupBox(parent)
self.group2.setObjectName('core')
self.group2.setGeometry(10,120,500,280)
self.group2.show()
self.group3 = QGroupBox(self.group2)
self.group3.setObjectName('albuminfos')
self.group3.setGeometry(10,15,200,245)
self.group3.show()
self.itemlist = QListWidget(self.group2)
self.itemlist.setGeometry(250,15,230,245)
self.itemlist.show()
self.dlgroup = QGroupBox(parent)
self.dlgroup.setObjectName('dlgroup')
self.dlgroup.setGeometry(10,420,500,100)
self.dlgroup.show()
self.dlgroup.dlbutton = QPushButton('Download', self.dlgroup)
self.dlgroup.dlbutton.setObjectName('dlbutton')
self.dlgroup.dlbutton.move(10,20)
self.dlgroup.dlbutton.show()
self.dlgroup.progressbar = QProgressBar(self.dlgroup)
self.dlgroup.progressbar.setObjectName('progressbar')
self.dlgroup.progressbar.setGeometry(100,21,380,21)
self.dlgroup.progressbar.show()
self.dlgroup.dlinfos = QLabel(self.dlgroup)
self.dlgroup.dlinfos.setGeometry(100,70,200,21)
self.dlgroup.dlinfos.show()
self.dlgroup.dledfile = QLabel(self.dlgroup)
self.dlgroup.dledfile.setGeometry(300,70,200,21)
self.dlgroup.dledfile.show()
self.dlgroup.dlto = QLineEdit('C:\\', self.dlgroup)
self.dlgroup.dlto.setGeometry(100,50,350,21)
self.dlgroup.dlto.show()
self.dlgroup.dlto.changebt = QToolButton(self.dlgroup)
self.dlgroup.dlto.changebt.setObjectName('dltobt')
self.dlgroup.dlto.changebt.setGeometry(10,50,75,21)
self.dlgroup.dlto.changebt.setText('To')
self.dlgroup.dlto.changebt.show()
self.dlgroup.dlto.openf = QPushButton('Open', self.dlgroup)
self.dlgroup.dlto.openf.setGeometry(455,50,35,21)
self.dlgroup.dlto.openf.setObjectName('openfolder')
self.dlgroup.dlto.openf.show()
self.album = QLabel(self.group3)
self.artist = QLabel(self.group3)
self.year = QLabel(self.group3)
self.tracks = QLabel(self.group3)
self.coverart = QLabel(self.group3)
self.urlbar.setFocus(True)
self.connect(self.parsebutton, SIGNAL('clicked()'), self.parseclicked )
self.connect(self.dlgroup.dlbutton, SIGNAL('clicked()'), self.launchdl)
self.connect(self.dlgroup.dlto.changebt, SIGNAL('clicked()'), self.changedir)
self.connect(self.dlgroup.dlto.openf, SIGNAL('clicked()'), self.openfolder)
def parseclicked(self):
self.itemlist.clear()
url = str(self.urlbar.text())
self.infos = getsonglist(url)
if (self.infos == 'connexion impossible') or (self.infos == 'unsupported'):
self.error = QMessageBox()
if self.infos == 'connexion impossible':
self.error.setText('Connexion Impossible !')
elif self.infos == 'unsupported':
self.error.setText('Site Unsupported !!')
self.error.setWindowTitle('Erreur!')
self.error.setIcon(QMessageBox.Warning)
self.icon = QIcon('images/mainwindowicon.png')
self.error.setWindowIcon(self.icon)
self.error.exec_()
else:
self.artist.setText('Artiste : ' + self.infos['artist'])
self.artist.move(40,175)
self.artist.show()
self.album.setText('Album : ' + self.infos['albumname'])
self.album.move(40,190)
self.album.show()
try:
self.year.setText('Annee : ' + self.infos['year'])
except KeyError:
self.year.setText('Annee : ' + 'N/A')
self.year.move(40,205)
self.year.show()
self.tracks.setText('Tracks : ' + str(self.infos['tracks']))
self.tracks.move(40,220)
#.........这里部分代码省略.........