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


Python Qt.lightGray方法代码示例

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


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

示例1: _update_table_view

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import lightGray [as 别名]
def _update_table_view(self):
        all_column_names, real_column_names, estimated_column_names, system_column_names = self._get_column_names()

        self.protocol_table.clear()
        self.protocol_table.setRowCount(self._protocol.length)
        self.protocol_table.setColumnCount(len(all_column_names))

        for index, column_name in enumerate(all_column_names):
            header_cell = QTableWidgetItem(column_name)
            if column_name in estimated_column_names:
                header_cell.setToolTip('This column is estimated from the other columns in the protocol.')
            self.protocol_table.setHorizontalHeaderItem(index, header_cell)

        for column_ind, column_name in enumerate(all_column_names):
            if column_name in system_column_names:
                generate_function = self._system_columns[column_name]
                cells = generate_function()
                for row, cell in enumerate(cells):
                    self.protocol_table.setItem(row, column_ind, cell)
            else:
                try:
                    values = self._protocol.get_column(column_name)
                    for row in range(self._protocol.length):
                        cell = NumericalSortedTableItem('{:e}'.format(values[row, 0]))
                        cell.setFlags(QtCore.Qt.ItemIsEnabled)

                        if column_name in estimated_column_names:
                            cell.setBackground(QBrush(Qt.lightGray))

                        self.protocol_table.setItem(row, column_ind, cell)
                except KeyError:
                    for row in range(self._protocol.length):
                        cell = QTableWidgetItem('?')
                        cell.setFlags(QtCore.Qt.ItemIsEnabled)
                        cell.setBackground(QBrush(Qt.lightGray))
                        self.protocol_table.setItem(row, column_ind, cell)

        self.protocol_table.resizeColumnsToContents() 
开发者ID:cbclab,项目名称:MDT,代码行数:40,代码来源:generate_protocol_tab.py

示例2: _create_volume_number_column

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import lightGray [as 别名]
def _create_volume_number_column(self):
        """Callback function to generate the volume number column cells.

        This should return a list of cells in the correct order.
        """
        cells = []
        for volume_nmr in range(self._protocol.length):
            cell = NumericalSortedTableItem(str(volume_nmr))
            cell.setFlags(QtCore.Qt.ItemIsEnabled)
            cell.setBackground(QBrush(Qt.lightGray))
            cells.append(cell)
        return cells 
开发者ID:cbclab,项目名称:MDT,代码行数:14,代码来源:generate_protocol_tab.py

示例3: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import lightGray [as 别名]
def __init__(self, parent=None):
        super(XmlSyntaxHighlighter, self).__init__(parent)

        self.highlightingRules = []

        # Tag format.
        format = QTextCharFormat()
        format.setForeground(Qt.darkBlue)
        format.setFontWeight(QFont.Bold)
        pattern = QRegExp("(<[a-zA-Z:]+\\b|<\\?[a-zA-Z:]+\\b|\\?>|>|/>|</[a-zA-Z:]+>)")
        self.highlightingRules.append((pattern, format))

        # Attribute format.
        format = QTextCharFormat()
        format.setForeground(Qt.darkGreen)
        pattern = QRegExp("[a-zA-Z:]+=")
        self.highlightingRules.append((pattern, format))

        # Attribute content format.
        format = QTextCharFormat()
        format.setForeground(Qt.red)
        pattern = QRegExp("(\"[^\"]*\"|'[^']*')")
        self.highlightingRules.append((pattern, format))

        # Comment format.
        self.commentFormat = QTextCharFormat()
        self.commentFormat.setForeground(Qt.lightGray)
        self.commentFormat.setFontItalic(True)

        self.commentStartExpression = QRegExp("<!--")
        self.commentEndExpression = QRegExp("-->") 
开发者ID:L1nwatch,项目名称:Mac-Python-3.X,代码行数:33,代码来源:schema.py


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