当前位置: 首页>>代码示例>>Python>>正文


Python QBrush.setStyle方法代码示例

本文整理汇总了Python中PyQt5.QtGui.QBrush.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Python QBrush.setStyle方法的具体用法?Python QBrush.setStyle怎么用?Python QBrush.setStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtGui.QBrush的用法示例。


在下文中一共展示了QBrush.setStyle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import setStyle [as 别名]
	def __init__(self, parent = None, message = None, itemType = "log"):
		QListWidgetItem.__init__(self)
		self.itemType = itemType

		if (itemType == "log"):
			self.setText("--- " + str(message))
		elif (itemType == "in"):
			self.setText("<<< " + str(message))
		elif (itemType == "out"):
			self.setText(">>> " + str(message))
		else:
			self.setText(str(message))

		font = QFont()
		font.setFamily("Monospace")
		if (itemType == "in") or (itemType == "out"):
			font.setBold(True)
			font.setWeight(75)
		else:
			font.setBold(False)
			font.setWeight(50)
		self.setFont(font)

		brush = QBrush(QColor(0, 0, 0))
		if (itemType == "in"):
			brush = QBrush(QColor(0, 0, 85))
		elif (itemType == "out"):
			brush = QBrush(QColor(0, 85, 0))
		brush.setStyle(Qt.NoBrush)
		self.setForeground(brush)
开发者ID:akkenoth,项目名称:BTSerial,代码行数:32,代码来源:LogItem.py

示例2: setStyle

# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import setStyle [as 别名]
 def setStyle(self, painter, fillColor, penColor, stroke):
     brush = QBrush()
     pen = QPen(penColor, stroke)
     brush.setColor(fillColor)
     brush.setStyle(Qt.SolidPattern)
     painter.setBrush(brush)
     painter.setPen(pen)
     painter.setRenderHint(QPainter.Antialiasing)
开发者ID:RoboticsURJC-students,项目名称:2016-tfg-vanessa-fernandez,代码行数:10,代码来源:referee.py

示例3: paintEvent

# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import setStyle [as 别名]
 def paintEvent(self, ev):
     pen = QPen()
     pen.setStyle(Qt.DotLine)
     pen.setWidth(2)
     pen.setColor(QColor(Qt.white))
     brush = QBrush()
     brush.setStyle(Qt.SolidPattern)
     brush.setColor(QColor(0, 0, 0))
     painter = QPainter(self)
     painter.setPen(pen)
     painter.setBrush(brush)
     painter.drawRect(ev.rect())
开发者ID:ozmartian,项目名称:ocr-translator,代码行数:14,代码来源:ocrtranslator.py

示例4: drawShape

# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import setStyle [as 别名]
 def drawShape(self, event, qp):
     pen = QPen(Qt.yellow)
     pen.setWidth(3)
     # rellenar fondo con patron de imagen
     brush = QBrush()
     brush.setTexture(QPixmap('image/small_image.jpg'))
     # establecer el QBrush
     qp.setBrush(brush)
     qp.setPen(pen)
     qp.drawRoundedRect(QRect(50, 50, 200, 150), 15, 15)
     # utilizar un patron predefinido
     brush.setStyle(Qt.DiagCrossPattern)
     qp.setBrush(brush)
     qp.drawEllipse(350, 50, 150, 150)
开发者ID:TutorProgramacion,项目名称:pyqt-tutorial,代码行数:16,代码来源:paint.py

示例5: getLogger

# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import setStyle [as 别名]
                             QGraphicsScene,
                             QGraphicsView,
                             QGroupBox,
                             QVBoxLayout,
                             )

from .settings import Config, FormInt
from .utils import convert_name_to_color, LINE_WIDTH

lg = getLogger(__name__)

NoPen = QPen()
NoPen.setStyle(Qt.NoPen)

NoBrush = QBrush()
NoBrush.setStyle(Qt.NoBrush)

STAGES = {'Wake': {'pos0': 5, 'pos1': 25, 'color': Qt.black},
          'Movement': {'pos0': 5, 'pos1': 25, 'color': Qt.darkGray},
          'REM': {'pos0': 10, 'pos1': 20, 'color': Qt.magenta},
          'NREM1': {'pos0': 15, 'pos1': 15, 'color': Qt.cyan},
          'NREM2': {'pos0': 20, 'pos1': 10, 'color': Qt.blue},
          'NREM3': {'pos0': 25, 'pos1': 5, 'color': Qt.darkBlue},
          'Undefined': {'pos0': 0, 'pos1': 30, 'color': Qt.gray},
          'Unknown': {'pos0': 30, 'pos1': 0, 'color': NoBrush},
          }

BARS = {'markers': {'pos0': 15, 'pos1': 10, 'tip': 'Markers in Dataset'},
        'annot': {'pos0': 30, 'pos1': 10,
                  'tip': 'Annotations (bookmarks and events)'},
        'stage': {'pos0': 45, 'pos1': 30, 'tip': 'Sleep Stage'},
开发者ID:gpiantoni,项目名称:phypno,代码行数:33,代码来源:overview.py

示例6: drawBrushes

# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import setStyle [as 别名]
    def drawBrushes(self, qp):
      
        brush = QBrush(Qt.SolidPattern)
        qp.setBrush(brush)
        qp.drawRect(10, 15, 90, 60)

        brush.setStyle(Qt.Dense1Pattern)
        qp.setBrush(brush)
        qp.drawRect(130, 15, 90, 60)

        brush.setStyle(Qt.Dense2Pattern)
        qp.setBrush(brush)
        qp.drawRect(250, 15, 90, 60)

        brush.setStyle(Qt.Dense3Pattern)
        qp.setBrush(brush)
        qp.drawRect(10, 105, 90, 60)

        brush.setStyle(Qt.DiagCrossPattern)
        qp.setBrush(brush)
        qp.drawRect(10, 105, 90, 60)

        brush.setStyle(Qt.Dense5Pattern)
        qp.setBrush(brush)
        qp.drawRect(130, 105, 90, 60)

        brush.setStyle(Qt.Dense6Pattern)
        qp.setBrush(brush)
        qp.drawRect(250, 105, 90, 60)

        brush.setStyle(Qt.HorPattern)
        qp.setBrush(brush)
        qp.drawRect(10, 195, 90, 60)

        brush.setStyle(Qt.VerPattern)
        qp.setBrush(brush)
        qp.drawRect(130, 195, 90, 60)

        brush.setStyle(Qt.BDiagPattern)
        qp.setBrush(brush)
        qp.drawRect(250, 195, 90, 60)
开发者ID:minus9d,项目名称:python_exercise,代码行数:43,代码来源:ch09-05-QBrush.py

示例7: QBrush

# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import setStyle [as 别名]
from pyqtgraph.functions import mkPen
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor, QBrush

# TODO: Pick color scheme

# RPE Table
_RPE_IDEAL_ALPHA = 140
_RPE_UNDESIRABLE_ALPHA = 120

RpeBrushIdeal = QBrush(QColor(255, 255, 0, _RPE_IDEAL_ALPHA))
RpeBrushIdeal.setStyle(Qt.SolidPattern)

RpeBrushUndesirable = QBrush(QColor(255, 0, 0, _RPE_UNDESIRABLE_ALPHA))
RpeBrushUndesirable.setStyle(Qt.SolidPattern)

bw_color_cols = ['Diff', 'Goal_Diff']
BW_TABLE_ALPHA = 120
LOG_START = 90
# TODO: Refactor other brushes, pick color scheme
green_brush = QBrush(QColor(0, 255, 0, BW_TABLE_ALPHA))
green_brush.setStyle(Qt.SolidPattern)

red_brush = QBrush(QColor(255, 0, 0, BW_TABLE_ALPHA))
red_brush.setStyle(Qt.SolidPattern)

blue_brush = QBrush(QColor(0, 0, 255, 120))
blue_brush.setStyle(Qt.SolidPattern)

gray_brush = QBrush(QColor(200, 200, 200, 70))
gray_brush.setStyle(Qt.SolidPattern)
开发者ID:nslee0,项目名称:trackster-py,代码行数:33,代码来源:Theme.py


注:本文中的PyQt5.QtGui.QBrush.setStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。