本文整理汇总了Python中PySide.QtCore.Qt.green方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.green方法的具体用法?Python Qt.green怎么用?Python Qt.green使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.green方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_finished
# 需要导入模块: from PySide.QtCore import Qt [as 别名]
# 或者: from PySide.QtCore.Qt import green [as 别名]
def process_finished(self, exit_code):
format = self.ui.edit_stdout.currentCharFormat()
format.setFontWeight(QFont.Bold)
if exit_code == 0:
if self._interrupted:
color = Qt.red
msg = ('Process interrupted by user')
else:
color = Qt.green
msg = ('Process exited normally')
else:
color = Qt.red
msg = ('Process exited with exit code %d' % exit_code)
format.setForeground(color)
self.ui.edit_stdout.setCurrentCharFormat(format)
self.ui.edit_stdout.appendPlainText(msg)
self.restore_gui()
self.ui.edit_stdout.setTextInteractionFlags(Qt.TextSelectableByMouse |
Qt.TextSelectableByKeyboard)
self.process = None
self.ui.btn_log.setEnabled(self.last_log_file is not None and
os.path.isfile(self.last_log_file))
示例2: paintEvent
# 需要导入模块: from PySide.QtCore import Qt [as 别名]
# 或者: from PySide.QtCore.Qt import green [as 别名]
def paintEvent(self, event):
self._draw_graph()
self._draw_reticle()
painter = QtGui.QPainter(self)
try:
painter.setRenderHint(QtGui.QPainter.Antialiasing)
painter.setPen(QtGui.QPen())
painter.setBrush(QtGui.QBrush())
if self._graph:
painter.drawPixmap(0, 0, self._graph)
if self._path_max:
painter.setPen(Qt.green)
painter.drawPath(self._path_max)
painter.setOpacity(0.5)
if self._reticle:
painter.drawPixmap(0, 0, self._reticle)
finally:
painter.end()