本文整理汇总了Python中PyQt5.QtWidgets.QProgressBar.palette方法的典型用法代码示例。如果您正苦于以下问题:Python QProgressBar.palette方法的具体用法?Python QProgressBar.palette怎么用?Python QProgressBar.palette使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QProgressBar
的用法示例。
在下文中一共展示了QProgressBar.palette方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CueWidget
# 需要导入模块: from PyQt5.QtWidgets import QProgressBar [as 别名]
# 或者: from PyQt5.QtWidgets.QProgressBar import palette [as 别名]
#.........这里部分代码省略.........
self._fade_element.enter_fadeout.disconnect(self._enter_fadeout)
self._fade_element.exit_fadein.disconnect(self._exit_fade)
self._fade_element.exit_fadeout.disconnect(self._exit_fade)
if new_fade is not None:
self._fade_element = new_fade
self._fade_element.enter_fadein.connect(self._enter_fadein)
self._fade_element.enter_fadeout.connect(self._enter_fadeout)
self._fade_element.exit_fadein.connect(self._exit_fade)
self._fade_element.exit_fadeout.connect(self._exit_fade)
def _update_name(self, name):
self.nameButton.setText(name)
def _update_description(self, description):
self.nameButton.setToolTip(description)
def _clicked(self, event):
if not self.seekSlider.geometry().contains(event.pos()):
if event.button() != Qt.RightButton:
if event.modifiers() == Qt.ShiftModifier:
self.edit_request.emit(self.cue)
elif event.modifiers() == Qt.ControlModifier:
self.selected = not self.selected
else:
self.cue_executed.emit(self.cue)
self.cue.execute()
def _update_style(self, stylesheet):
stylesheet += 'text-decoration: underline;' if self.selected else ''
self.nameButton.setStyleSheet(stylesheet)
def _enter_fadein(self):
p = self.timeDisplay.palette()
p.setColor(p.WindowText, QColor(0, 255, 0))
self.timeDisplay.setPalette(p)
def _enter_fadeout(self):
p = self.timeDisplay.palette()
p.setColor(p.WindowText, QColor(255, 50, 50))
self.timeDisplay.setPalette(p)
def _exit_fade(self):
self.timeDisplay.setPalette(self.timeBar.palette())
def _status_stopped(self):
self.statusIcon.setPixmap(CueWidget.STOP.pixmap(CueWidget.ICON_SIZE,
CueWidget.ICON_SIZE))
self._update_time(0, True)
def _status_playing(self):
self.statusIcon.setPixmap(CueWidget.START.pixmap(CueWidget.ICON_SIZE,
CueWidget.ICON_SIZE))
def _status_paused(self):
self.statusIcon.setPixmap(CueWidget.PAUSE.pixmap(CueWidget.ICON_SIZE,
CueWidget.ICON_SIZE))
def _status_error(self, cue, error, details):
self.statusIcon.setPixmap(CueWidget.ERROR.pixmap(CueWidget.ICON_SIZE,
CueWidget.ICON_SIZE))
QDetailedMessageBox.dcritical(self.cue.name, error, details)
def _update_duration(self, duration):
# Update the maximum values of seek-slider and time progress-bar
if duration > 0: