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


Python QtGui.QBrush方法代码示例

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


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

示例1: data_internal

# 需要导入模块: from qtpy import QtGui [as 别名]
# 或者: from qtpy.QtGui import QBrush [as 别名]
def data_internal(self, index, record, role):
        result = None
        if role == Qt.DisplayRole:
            if index.column() == self.columnCount(INVALID_INDEX) - 1:
                result = record._cutelog
            else:
                column = self.table_header[index.column()]
                if column.name == 'asctime':
                    result = record.asctime
        elif role == Qt.SizeHintRole:
            result = QSize(1, CONFIG.logger_row_height)
        elif role == Qt.FontRole:
            result = QFont(CONFIG.logger_table_font, CONFIG.logger_table_font_size)
        elif role == Qt.ForegroundRole:
            if not self.dark_theme:
                result = QColor(Qt.black)
            else:
                result = QColor(Qt.white)
        elif role == Qt.BackgroundRole:
            if not self.dark_theme:
                color = QColor(Qt.lightGray)
            else:
                color = QColor(Qt.darkGray)
            result = QBrush(color, Qt.BDiagPattern)
        return result 
开发者ID:busimus,项目名称:cutelog,代码行数:27,代码来源:logger_tab.py

示例2: get_preview_items

# 需要导入模块: from qtpy import QtGui [as 别名]
# 或者: from qtpy.QtGui import QBrush [as 别名]
def get_preview_items(self, level):
        previewItem = QTableWidgetItem("Log message")
        previewItem.setBackground(QBrush(level.bg, Qt.SolidPattern))
        previewItem.setForeground(QBrush(level.fg, Qt.SolidPattern))
        previewItemDark = QTableWidgetItem("Log message")
        previewItemDark.setBackground(QBrush(level.bgDark, Qt.SolidPattern))
        previewItemDark.setForeground(QBrush(level.fgDark, Qt.SolidPattern))
        font = QFont(CONFIG.logger_table_font, CONFIG.logger_table_font_size)
        fontDark = QFont(font)
        if 'bold' in level.styles:
            font.setBold(True)
        if 'italic' in level.styles:
            font.setItalic(True)
        if 'underline' in level.styles:
            font.setUnderline(True)
        if 'bold' in level.stylesDark:
            fontDark.setBold(True)
        if 'italic' in level.stylesDark:
            fontDark.setItalic(True)
        if 'underline' in level.stylesDark:
            fontDark.setUnderline(True)
        previewItem.setFont(font)
        previewItemDark.setFont(fontDark)
        return previewItem, previewItemDark 
开发者ID:busimus,项目名称:cutelog,代码行数:26,代码来源:levels_preset_dialog.py

示例3: setColor

# 需要导入模块: from qtpy import QtGui [as 别名]
# 或者: from qtpy.QtGui import QBrush [as 别名]
def setColor(self, color):
        self._color = color
        self._ellipseItem.setBrush(QtGui.QBrush(self._color)) 
开发者ID:EricTRocks,项目名称:pyflowgraph,代码行数:5,代码来源:port.py

示例4: highlight

# 需要导入模块: from qtpy import QtGui [as 别名]
# 或者: from qtpy.QtGui import QBrush [as 别名]
def highlight(self):
        self._ellipseItem.setBrush(QtGui.QBrush(self._color.lighter()))
        # make the port bigger to highlight it can accept the connection.
        self._ellipseItem.setRect(
            -self.__radius * 1.3,
            -self.__radius * 1.3,
            self.__diameter * 1.3,
            self.__diameter * 1.3,
            ) 
开发者ID:EricTRocks,项目名称:pyflowgraph,代码行数:11,代码来源:port.py

示例5: unhighlight

# 需要导入模块: from qtpy import QtGui [as 别名]
# 或者: from qtpy.QtGui import QBrush [as 别名]
def unhighlight(self):
        self._ellipseItem.setBrush(QtGui.QBrush(self._color))
        self._ellipseItem.setRect(
            -self.__radius,
            -self.__radius,
            self.__diameter,
            self.__diameter,
            )


    # ===================
    # Connection Methods
    # =================== 
开发者ID:EricTRocks,项目名称:pyflowgraph,代码行数:15,代码来源:port.py

示例6: _get_brush

# 需要导入模块: from qtpy import QtGui [as 别名]
# 或者: from qtpy.QtGui import QBrush [as 别名]
def _get_brush(self, color):
        """ Returns a brush for the color.
        """
        result = self._brushes.get(color)
        if result is None:
            qcolor = self._get_color(color)
            result = QtGui.QBrush(qcolor)
            self._brushes[color] = result
        return result 
开发者ID:jupyter,项目名称:qtconsole,代码行数:11,代码来源:pygments_highlighter.py

示例7: __init__

# 需要导入模块: from qtpy import QtGui [as 别名]
# 或者: from qtpy.QtGui import QBrush [as 别名]
def __init__(self, widget1, widget2, h_first, parent, show_arrow=True):
        self.parent = parent
        self.widget_start = widget1
        self.widget_stop = widget2
        self.h_first = h_first
        self.show_arrow = show_arrow

        self.brush = QtGui.QBrush(QtCore.Qt.black)
        self.arrow = QtWidgets.QGraphicsPolygonItem()
        self.arrow.setBrush(self.brush)
        self.pen = QtGui.QPen(QtCore.Qt.black,
                              3,
                              QtCore.Qt.SolidLine,
                              QtCore.Qt.RoundCap,
                              QtCore.Qt.RoundJoin)

        self.line1 = QtWidgets.QGraphicsLineItem()
        self.line1.setPen(self.pen)
        self.line2 = QtWidgets.QGraphicsLineItem()
        self.line2.setPen(self.pen)
        self.line1.setZValue(1)
        self.line2.setZValue(1)

        self.parent.scene.addItem(self.line1)
        self.parent.scene.addItem(self.line2)
        self.parent.scene.addItem(self.arrow)
        self.adjust() 
开发者ID:lneuhaus,项目名称:pyrpl,代码行数:29,代码来源:schematics.py


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