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


Python Qt.yellow方法代码示例

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


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

示例1: _setMark

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def _setMark(self):
        row = self._markedItem.row()

        markBg = QColor(Qt.yellow)
        self.setRowBackground(row, markBg)

        for col in range(self.columnCount()):
            if self.__index and col == 0:
                self._markedItemsOriginalForeground.append(None)
                continue

            item = self.item(row, col)
            fg = item.foreground().color()
            
            # only change qdarkstyle default foreground
            if fg == QColor(0, 0, 0) or fg == QColor(192, 192, 192):
                item.setForeground(QColor(0, 0, 0))

            # for qdarkstyle default foreground
            if fg == QColor(0, 0, 0):
                fg = QColor(192, 192, 192)

            # save
            self._markedItemsOriginalForeground.append(fg) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:26,代码来源:DyTableWidget.py

示例2: onToggleExpiring

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def onToggleExpiring(self):
        if self.ui.toggleExpiring_btn.text() == "Hide Expiring":
            # Hide expiring proposals
            for row in range(0, self.ui.proposalBox.rowCount()):
                if self.ui.proposalBox.item(row,5).background() == Qt.yellow:
                    self.ui.proposalBox.hideRow(row)
            # Update button
            self.ui.toggleExpiring_btn.setToolTip("Show expiring proposals (yellow background) in list")
            self.ui.toggleExpiring_btn.setText("Show Expiring")

        else:
            # Show expiring proposals
            for row in range(0, self.ui.proposalBox.rowCount()):
                if self.ui.proposalBox.item(row,5).background() == Qt.yellow:
                    self.ui.proposalBox.showRow(row)
            # Update button
            self.ui.toggleExpiring_btn.setToolTip("Hide expiring proposals (yellow background) from list")
            self.ui.toggleExpiring_btn.setText("Hide Expiring") 
开发者ID:PIVX-Project,项目名称:PIVX-SPMT,代码行数:20,代码来源:tabGovernance.py

示例3: setBlackoutColors

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def setBlackoutColors(self):
        global colors
        global orange
        colors = [Qt.red, Qt.yellow, Qt.darkYellow, Qt.green, Qt.darkGreen, orange, Qt.blue,Qt.cyan, Qt.darkCyan, Qt.magenta, Qt.darkMagenta, Qt.gray]

        # return
        # self.setStyleSheet("background-color: black")
        #self.Plot24.setBackgroundBrush(Qt.black)
        mainTitleBrush = QBrush(Qt.red)
        self.chart24.setTitleBrush(mainTitleBrush)
        self.chart5.setTitleBrush(mainTitleBrush)
        
        self.chart24.setBackgroundBrush(QBrush(Qt.black))
        self.chart24.axisX().setLabelsColor(Qt.white)
        self.chart24.axisY().setLabelsColor(Qt.white)
        titleBrush = QBrush(Qt.white)
        self.chart24.axisX().setTitleBrush(titleBrush)
        self.chart24.axisY().setTitleBrush(titleBrush)
        #self.Plot5.setBackgroundBrush(Qt.black)
        self.chart5.setBackgroundBrush(QBrush(Qt.black))
        self.chart5.axisX().setLabelsColor(Qt.white)
        self.chart5.axisY().setLabelsColor(Qt.white)
        self.chart5.axisX().setTitleBrush(titleBrush)
        self.chart5.axisY().setTitleBrush(titleBrush)
        
        #$ self.networkTable.setStyleSheet("QTableCornerButton::section{background-color: white;}")
        # self.networkTable.cornerWidget().setStylesheet("background-color: black")
        self.networkTable.setStyleSheet("QTableView {background-color: black;gridline-color: white;color: white} QTableCornerButton::section{background-color: white;}")
        headerStyle = "QHeaderView::section{background-color: white;border: 1px solid black;color: black;} QHeaderView::down-arrow,QHeaderView::up-arrow {background: none;}"
        self.networkTable.horizontalHeader().setStyleSheet(headerStyle)
        self.networkTable.verticalHeader().setStyleSheet(headerStyle) 
开发者ID:ghostop14,项目名称:sparrow-wifi,代码行数:33,代码来源:sparrow-wifi.py

示例4: onCurrentTextChanged

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def onCurrentTextChanged(self, currentText):
        self.resultView.appendHtml(
            '{0}: {1}'.format(
                formatColor('currentTextChanged', QColor(Qt.yellow)), currentText)) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:6,代码来源:SignalsExample.py

示例5: onGPSStatus

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def onGPSStatus(self, updateStatusBar=True):
        if (not self.remoteAgentUp):
            # Checking local GPS
            if GPSEngine.GPSDRunning():
                if self.gpsEngine.gpsValid():
                    self.gpsSynchronized = True
                    self.btnGPSStatus.setStyleSheet("background-color: green; border: 1px;")
                    if updateStatusBar:
                        self.statusBar().showMessage('Local gpsd service is running and satellites are synchronized.')
                else:
                    self.gpsSynchronized = False
                    self.btnGPSStatus.setStyleSheet("background-color: yellow; border: 1px;")
                    if updateStatusBar:
                        self.statusBar().showMessage("Local gpsd service is running but it's not synchronized with the satellites yet.")
                    
            else:
                self.gpsSynchronized = False
                if updateStatusBar:
                    self.statusBar().showMessage('No local gpsd running.')
                self.btnGPSStatus.setStyleSheet("background-color: red; border: 1px;")
        else:
            # Checking remote
            errCode, errMsg, gpsStatus = requestRemoteGPS(self.remoteAgentIP, self.remoteAgentPort)
            
            if errCode == 0:
                self.missedAgentCycles = 0
                if (gpsStatus.isValid):
                    self.gpsSynchronized = True
                    self.btnGPSStatus.setStyleSheet("background-color: green; border: 1px;")
                    self.statusBar().showMessage("Remote GPS is running and synchronized.")
                elif (gpsStatus.gpsRunning):
                    self.gpsSynchronized = False
                    self.btnGPSStatus.setStyleSheet("background-color: yellow; border: 1px;")
                    self.statusBar().showMessage("Remote GPS is running but it has not synchronized with the satellites yet.")
                else:
                    self.gpsSynchronized = False
                    self.statusBar().showMessage("Remote GPS service is not running.")
                    self.btnGPSStatus.setStyleSheet("background-color: red; border: 1px;")
            else:
                agentUp = portOpen(self.remoteAgentIP, self.remoteAgentPort)
                # Agent may be up but just taking a while to respond.
                if (not agentUp) or errCode == -1:
                    self.missedAgentCycles += 1
                    
                    if (not agentUp) or (self.missedAgentCycles > self.allowedMissedAgentCycles):
                        # We may let it miss a cycle or two just as a good practice
                        
                        # Agent disconnected.
                        # Stop any active scan and transition local
                        self.agentDisconnected()
                        self.statusBar().showMessage("Error connecting to remote agent.  Agent disconnected.")
                        QMessageBox.question(self, 'Error',"Error connecting to remote agent.  Agent disconnected.", QMessageBox.Ok)
                else:
                    self.statusBar().showMessage("Remote GPS Error: " + errMsg)
                    self.btnGPSStatus.setStyleSheet("background-color: red; border: 1px;") 
开发者ID:ghostop14,项目名称:sparrow-wifi,代码行数:57,代码来源:sparrow-wifi.py

示例6: createChart

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def createChart(self):
        self.timeChart = QChart()
        titleFont = QFont()
        titleFont.setPixelSize(18)
        titleBrush = QBrush(QColor(0, 0, 255))
        self.timeChart.setTitleFont(titleFont)
        self.timeChart.setTitleBrush(titleBrush)
        self.timeChart.setTitle('Signal (Past ' + str(self.maxPoints) + ' Samples)')
        # self.timeChart.addSeries(testseries)
        # self.timeChart.createDefaultAxes()
        self.timeChart.legend().hide()
        
        # Axis examples: https://doc.qt.io/qt-5/qtcharts-multiaxis-example.html
        newAxis = QValueAxis()
        newAxis.setMin(0)
        newAxis.setMax(self.maxPoints)
        newAxis.setTickCount(11)
        newAxis.setLabelFormat("%d")
        newAxis.setTitleText("Sample")
        self.timeChart.addAxis(newAxis, Qt.AlignBottom)
        
        newAxis = QValueAxis()
        newAxis.setMin(-100)
        newAxis.setMax(-10)
        newAxis.setTickCount(9)
        newAxis.setLabelFormat("%d")
        newAxis.setTitleText("dBm")
        self.timeChart.addAxis(newAxis, Qt.AlignLeft)
        
        chartBorder = Qt.darkGray
        self.timePlot = QChartView(self.timeChart, self)
        self.timePlot.setBackgroundBrush(chartBorder)
        self.timePlot.setRenderHint(QPainter.Antialiasing)
        
        self.timeSeries = QLineSeries()
        pen = QPen(Qt.yellow)
            
        pen.setWidth(2)
        self.timeSeries.setPen(pen)
        self.timeChart.addSeries(self.timeSeries)
        self.timeSeries.attachAxis(self.timeChart.axisX())
        self.timeSeries.attachAxis(self.timeChart.axisY()) 
开发者ID:ghostop14,项目名称:sparrow-wifi,代码行数:44,代码来源:telemetry.py

示例7: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def __init__(self, *args, **kwargs):
        super(ButtonsWidget, self).__init__(*args, **kwargs)
        layout = QGridLayout(self)
        loader = CIconLoader.fontMaterial()

        # 创建一个多态的icon
        icon = loader.icon('mdi-qqchat')
        icon.add('mdi-access-point', Qt.red, QIcon.Normal, QIcon.On)

        icon.add('mdi-camera-metering-matrix',
                 Qt.green, QIcon.Disabled, QIcon.Off)
        icon.add('mdi-file-document-box-check',
                 Qt.blue, QIcon.Disabled, QIcon.On)

        icon.add('mdi-magnify-minus', Qt.cyan, QIcon.Active, QIcon.Off)
        icon.add('mdi-account', Qt.magenta, QIcon.Active, QIcon.On)

        icon.add('mdi-camera-off', Qt.yellow, QIcon.Selected, QIcon.Off)
        icon.add('mdi-set-center', Qt.white, QIcon.Selected, QIcon.On)

        layout.addWidget(QLabel('Normal', self), 0, 0)
        layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
            'mdi-qqchat'), font=loader.font, iconSize=QSize(36, 36)), 0, 1)

        layout.addWidget(QLabel('Disabled', self), 1, 0)
        layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
            'mdi-qqchat'), enabled=False, font=loader.font, iconSize=QSize(48, 48)), 1, 1)

        layout.addWidget(QLabel('Active', self), 2, 0)
        layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
            'mdi-qqchat'), font=loader.font, iconSize=QSize(64, 64)), 2, 1)

        layout.addWidget(QLabel('Selected', self), 3, 0)
        layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
            'mdi-qqchat'), font=loader.font, checkable=True, checked=True), 3, 1)

        # 旋转动画
        aniButton = QPushButton(self, iconSize=QSize(48, 48))
        loader = CIconLoader.fontAwesome()
        icon = loader.icon(
            'fa-spinner', animation=CIconAnimationSpin(aniButton, 10, 4))
        aniButton.setIcon(icon)
        layout.addWidget(QLabel('动画', self), 4, 0)
        layout.addWidget(aniButton, 4, 1) 
开发者ID:PyQt5,项目名称:CustomWidgets,代码行数:46,代码来源:TestCFontIcon.py

示例8: crearGraficoBarras

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def crearGraficoBarras(self):
        paises = ["EEUU", "China", "Japon", "Alemania", "Reino Unido", "Resto del mundo"]
        valores = [24.32, 14.85, 8.91, 12.54, 7.85, 31.53]
        colores = [Qt.blue, Qt.red, Qt.darkYellow, Qt.gray, Qt.black, Qt.darkCyan]

        grafico = QChart()
        grafico.setMargins(QMargins(30, 30, 30, 30))
        grafico.setTheme(QChart.ChartThemeLight)
        grafico.setTitle("% Distribución del PIB global")
        grafico.setAnimationOptions(QChart.SeriesAnimations)

        for i in range(len(paises)):
            series = QBarSeries()
            
            barSet = QBarSet(paises[i])
            barSet.setColor(colores[i])
            barSet.setLabelColor(Qt.yellow)
            barSet.append(valores[i])
            
            series.append(barSet)
            series.setLabelsVisible(True)
            series.setLabelsAngle(-90)
            # series.setLabelsPrecision(2)
            series.setLabelsFormat("@value %")
            series.setLabelsPosition(QAbstractBarSeries.LabelsCenter)
            
            grafico.addSeries(series)

        axisX = QBarCategoryAxis()
        axisX.append(paises)

        axisY = QValueAxis()
        axisY.setRange(0, 31.53)
        axisY.setTickCount(10)
        axisY.setLabelFormat("%.2f %")
        
        grafico.createDefaultAxes()
        grafico.setAxisX(axisX, None)
        grafico.setAxisY(axisY, None)

        grafico.legend().setVisible(True)
        grafico.legend().setAlignment(Qt.AlignBottom)

        return grafico 
开发者ID:andresnino,项目名称:PyQt5,代码行数:46,代码来源:graficoBarras.py

示例9: get_schema_update_treeWidget

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import yellow [as 别名]
def get_schema_update_treeWidget(self):
        """ Get table schema from database, and update the tables_an_views tree widget.
        The schema needs to be updated when drop table or create queries are run. """

        self.schema = []
        tableDict = {}
        cur = self.app.conn.cursor()
        cur.execute("SELECT sql, type, name FROM sqlite_master WHERE type IN ('table', 'view') ")
        result = cur.fetchall()
        for row in result:
            tableName = row[2]
            fields = []
            fieldResults = cur.execute("PRAGMA table_info(" + tableName + ")")
            # each field is a tuple of cid, name, type (integer, text, ), notNull (1=notNull),
            # defaultValue(None usually), primaryKey(as integers 1 up, or 0)
            for field in fieldResults:
                fields.append(field)
            tableDict[tableName] = fields
        self.schema = tableDict

        # update tables and views in tree widget
        tablesAndViews = []
        for k in self.schema.keys():
            tablesAndViews.append(k)
        tablesAndViews.sort()
        self.ui.treeWidget.clear()
        for tableName in tablesAndViews:
            topItem = QtWidgets.QTreeWidgetItem()
            topItem.setText(0, tableName)
            result = cur.execute("SELECT type FROM sqlite_master WHERE name='" + tableName + "' ")
            tableOrView = result.fetchone()[0]
            if tableOrView == "view":
                topItem.setBackground(0, QtGui.QBrush(Qt.yellow, Qt.Dense6Pattern))
            self.ui.treeWidget.addTopLevelItem(topItem)
            for field in self.schema[tableName]:
                fieldItem = QtWidgets.QTreeWidgetItem()
                if tableOrView == "view":
                    fieldItem.setBackground(0, QtGui.QBrush(Qt.yellow, Qt.Dense6Pattern))
                if field[5] > 0:
                    fieldItem.setForeground(0, QtGui.QBrush(Qt.red))
                fieldItem.setText(0, field[1])
                topItem.addChild(fieldItem)

        # add join syntax
        joinItem = QtWidgets.QTreeWidgetItem()
        joinItem.setText(0, "-- Joins --")
        self.ui.treeWidget.addTopLevelItem(joinItem)
        for join in self.joinData:
            jItem = QtWidgets.QTreeWidgetItem()
            jItem.setText(0, join)
            joinItem.addChild(jItem)

    # sql text edit widget context menu 
开发者ID:ccbogel,项目名称:QualCoder,代码行数:55,代码来源:dialog_sql.py


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