當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。