本文整理汇总了Python中PyQt4.QtGui.QGroupBox.setAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox.setAlignment方法的具体用法?Python QGroupBox.setAlignment怎么用?Python QGroupBox.setAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGroupBox
的用法示例。
在下文中一共展示了QGroupBox.setAlignment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addPreview
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setAlignment [as 别名]
def addPreview(self, boite='vbox', nomPreview = None, light = False, mode = "Video"):
# ----------------------------
# Boite de groupe de mplayer
# ----------------------------
group=QGroupBox("")
if nomPreview == None : nomPreview=_(u'Visionner vidéo')
else : nomPreview=_(nomPreview)
vboxMplayer = QVBoxLayout(group)
if mode =="Video+Audio" :
vidtitre = QLabel(_(u"Vidéo"))
vidtitre.setAlignment(Qt.AlignHCenter)
vboxMplayer.addWidget(vidtitre)
self.mplayer=Mplayer(taille=(250, 225), choixWidget=(Mplayer.RATIO, Mplayer.PAS_PRECEDENT_SUIVANT,Mplayer.CURSEUR_SUR_UNE_LIGNE,Mplayer.PAS_PARCOURIR, Mplayer.LIST))
## On utilise la nouvelle interface de récupération des vidéos
self.mplayer.listeVideos = []
self.mplayer.setEnabled(False)
hbox = QHBoxLayout()
hbox.addStretch()
hbox.addWidget(self.mplayer)
hbox.addStretch()
vboxMplayer.addLayout(hbox)
hbox = QHBoxLayout()
if not light :
self.radioSource = QRadioButton(_(u"vidéo(s) source(s)"))
self.radioSource.setChecked(True)
self.radioSource.setEnabled(False)
self.connect(self.radioSource, SIGNAL("toggled(bool)"), self.fctRadioSource)
self.radioConvert = QRadioButton(_(u"vidéo(s) convertie(s)"))
self.radioConvert.setEnabled(False)
self.connect(self.radioConvert, SIGNAL("toggled(bool)"), self.fctRadioConvert)
self.boutCompare = QPushButton(_(u"Comparateur de vidéos"))
self.boutCompare.setEnabled(False)
self.connect(self.boutCompare, SIGNAL("clicked()"), self.widget2Mplayer)
hbox.addWidget(self.radioSource)
hbox.addWidget(self.radioConvert)
hbox.addWidget(self.boutCompare)
if self.idSection == "animation_filtresvideo":
self.boutApercu = QPushButton(_(u"Aperçu"))
self.connect(self.boutApercu, SIGNAL("clicked()"), self.apercu)
self.boutApercu.setEnabled(False)
hbox.addWidget(self.boutApercu)
if mode =="Video+Audio" :
self.mplayerA=Mplayer(taille=(250, 225), choixWidget=(Mplayer.RATIO,Mplayer.PAS_PRECEDENT_SUIVANT,Mplayer.CURSEUR_SUR_UNE_LIGNE,Mplayer.PAS_PARCOURIR))
self.mplayerA.setAudio(True)
self.mplayerA.listeVideos = []
self.mplayerA.setEnabled(False)
hboxA = QHBoxLayout()
hboxA.addStretch()
hboxA.addWidget(self.mplayerA)
hboxA.addStretch()
hbox.setAlignment(Qt.AlignHCenter)
vboxMplayer.addLayout(hbox)
if mode =="Video+Audio" :
audtitre = QLabel(_(u"Audio"))
audtitre.setAlignment(Qt.AlignHCenter)
vboxMplayer.addWidget(audtitre)
vboxMplayer.addLayout(hboxA)
vboxMplayer.addStretch()
group.setAlignment(Qt.AlignHCenter)
self.add(group, nomPreview)
示例2: GUI
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setAlignment [as 别名]
#.........这里部分代码省略.........
self.eFilter = LabelEventFilter()
def on_start(self):
"""
Additional procedures run on application start.
"""
# Let's initialize even some stuff!
self.al = None
self.auth_thread = None
self.init_backend()
choose_db(str(self.availableDB.currentText()))
self.showDB.setText("&Change DB (active: %s)" % self.availableDB.currentText())
self.stats = StatsUI(self.al, self)
def init_composition(self):
"""
Window composition and general params.
"""
self.setWindowTitle(NAME + ' ' + __version__)
desktop = QApplication.desktop()
self.setGeometry((desktop.width() - WIDTH)/2,
(desktop.height() - HEIGHT)/2, WIDTH, HEIGHT)
def init_contents(self):
"""
Setting up qt controls.
"""
self.changeDB.hide()
self.availableDB.hide()
self.availableDB.addItems(dbs.keys())
self.kanjiGroup.setAlignment(Qt.AlignCenter)
self.kanjiGroup.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; }")
self.day.setAlignment(Qt.AlignCenter)
self.week.setAlignment(Qt.AlignCenter)
self.month.setAlignment(Qt.AlignCenter)
self.year.setAlignment(Qt.AlignCenter)
self.dayLabel.setAlignment(Qt.AlignCenter)
self.weekLabel.setAlignment(Qt.AlignCenter)
self.monthLabel.setAlignment(Qt.AlignCenter)
self.yearLabel.setAlignment(Qt.AlignCenter)
self.day.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.week.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.month.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.year.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.methodCombo.addItems(RandomMess.algs.keys())
self.methodCombo.setCurrentIndex(1)
self.statusMessage.setAlignment(Qt.AlignCenter)
self.statusMessage.hide()
self.statusMessage.setMaximumHeight(MESSAGE_HEIGHT)
self.statusMessage.setStyleSheet(WARNING_STYLE)
self.progressBar.setMaximum(0)
self.progressBar.setMaximumHeight(PROGRESS_HEIGHT)
self.progressBar.hide()
QToolTip.setFont(QFont(PRETTY_FONT, TOOLTIP_FONT_SIZE))
self.getAll.setToolTip('Randomly select all 4 kanji')
self.methodCombo.setToolTip('Choose algorithm for randomness')