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


Python QPalette.setColor方法代码示例

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


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

示例1: createDisplay

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
    def createDisplay(self):
        self.displayLCD = QGroupBox("")
        layout = QHBoxLayout()

        paletteLosses = QPalette()
        paletteVictory = QPalette()

        paletteLosses.setColor(paletteLosses.WindowText, QColor(255, 000, 000))
        paletteVictory.setColor(paletteVictory.WindowText, QColor(000, 255, 000))

        self.lossesLcd = QLCDNumber(3)
        self.lossesLcd.setSegmentStyle(QLCDNumber.Filled)
        self.lossesLcd.setPalette(paletteLosses)

        self.victoryLcd = QLCDNumber(3)
        self.victoryLcd.setSegmentStyle(QLCDNumber.Filled)
        self.victoryLcd.setPalette(paletteVictory)

        self.lossesLcd.setMinimumHeight(100)
        self.victoryLcd.setMinimumHeight(100)

        self.lossesLcd.setMinimumWidth(150)
        self.victoryLcd.setMinimumWidth(150)

        layout.addWidget(self.victoryLcd)
        layout.addWidget(self.lossesLcd)

        self.displayLCD.setLayout(layout)
开发者ID:leosalvadori,项目名称:WinLossCount,代码行数:30,代码来源:DisplayObjetives.py

示例2: __init__

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
 def __init__(self, parent=None, interval=50):
     QWidget.__init__(self, parent)
     palette = QPalette(self.palette())
     palette.setColor(palette.Background, Qt.transparent)
     self.setPalette(palette)
     self.counter = 0
     self.interval = interval
开发者ID:Arzaroth,项目名称:HearthPacks,代码行数:9,代码来源:menu.py

示例3: start_report

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
 def start_report(self): 
     self.viewQueues.start()
     self.setEnabled(False)
     bgColor = QPalette()
     bgColor.setColor(self.backgroundRole(), Qt.lightGray)
     self.setPalette(bgColor)
     self.myLoadingMovie.show()
开发者ID:dhoy,项目名称:KornitPrint,代码行数:9,代码来源:kornit_print.py

示例4: __init__

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
	def __init__(self, *args, **kwargs):
		super(ImageViewerCenter, self).__init__(*args, **kwargs)
		self.zoomMode = ZOOM_FACTOR
		self.zoomFactor = 1
		self.moving = None

		imgWidget = QLabel()
		imgWidget.setMouseTracking(True)
		imgWidget.setAlignment(Qt.AlignCenter)
		self.setWidget(imgWidget)

		self.setAlignment(Qt.AlignCenter)
		self.setMouseTracking(True)
		self.setFrameShape(self.NoFrame)
		self.setWidgetResizable(True)

		pal = QPalette()
		pal.setColor(QPalette.Window, Qt.black)
		self.setPalette(pal)

		self.leftZone = False
		self.topZone = False

		self.file = None
		self.movie = None
开发者ID:hydrargyrum,项目名称:sit-tagger,代码行数:27,代码来源:fullscreenviewer.py

示例5: setBackGround

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
	def setBackGround(self,backColor):
		if self.isSetBackground : return
		palette = QPalette()
		palette.setColor(QPalette.Background,backColor)
		self.setAutoFillBackground(True)
		self.setPalette(palette);
		self.isSetBackground = True
开发者ID:3qwasd,项目名称:jobs,代码行数:9,代码来源:SImageBrower.py

示例6: __init__

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
 def __init__(self):
     super(AvailableSizes, self).__init__()
     
     self.createCombos()
     self.createHeader()
     #self.createMenuBar()
     
     self.printOut = QTextEdit()
     self.printOut.setFont(QFont('Helvetica', 11, QFont.Bold))
     self.printOut.setReadOnly(True)
     
     mainLayout = QVBoxLayout()
     #mainLayout.setMenuBar(self.menuBar)
     mainLayout.addWidget(self.frmHeader)
     mainLayout.addWidget(self.grpBox)
     mainLayout.addWidget(self.printOut)
     #mainLayout.setAlignment(self.frmHeader, Qt.AlignRight)
     self.setLayout(mainLayout)
     
     #self.setWindowTitle("Available Sizes")
     self.setWindowFlags(Qt.FramelessWindowHint)
     bgColor = QPalette()
     bgColor.setColor(self.backgroundRole(), Qt.gray)
     self.setPalette(bgColor)
     self.setWindowIcon(QIcon('icon/PS_Icon.png'))
     self.cbSku.setFocus()
开发者ID:Ink-Pixi,项目名称:AvailableSizes,代码行数:28,代码来源:availableSizes.py

示例7: initUI

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
    def initUI(self):
        """Creates parts of layout that account for sizes.
        Notable is that the boardScene squares will be a multiple of 8."""
        screens = [QDesktopWidget().availableGeometry(i) for i in
                   range(QDesktopWidget().screenCount())]
        assert screens
        maxWidth = max(min(s.width(), s.height()) for s in screens)
        sceneWidth = int(maxWidth / 8) * 8
        self.boardScene.initSquares(sceneWidth / 8)
        self.boardScene.setSceneRect(0, 0, sceneWidth, sceneWidth)
        self.boardSceneView.initUI(sceneWidth)

        """Creates layout without accounting for sizes"""
        pal = QPalette(self.palette())
        pal.setColor(QPalette.Background, Qt.green)
        self.setAutoFillBackground(True)
        self.setPalette(pal)
        self.vertLayout = QVBoxLayout(self)
        self.vertLayout.setSpacing(0)
        self.vertLayout.setContentsMargins(0, 0, 0, 0)
        self.vertLayout.addWidget(self.moveTreeView)
        self.vertLayout.addWidget(self.engineWidget)
        self.vertWidget = QWidget(self)
        self.vertWidget.setLayout(self.vertLayout)
        horiLayout = QHBoxLayout(self)
        horiLayout.setSpacing(0)
        horiLayout.setContentsMargins(0, 0, 0, 0)
        horiLayout.addWidget(self.boardSceneView)
        horiLayout.addWidget(self.vertWidget)
        self.setLayout(horiLayout)
开发者ID:thesmartwon,项目名称:OpenChess-Python,代码行数:32,代码来源:centralwidget.py

示例8: create_table

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
  def create_table(self, tblType):
      
      data = self.db.get_table_data(tblType)
          
      font = QFont('Veranda', 12, QFont.Bold)
      blk = QPalette()
      blk.setColor(blk.Foreground, Qt.black)      
 
      # Check to make sure the list is there and has data, then we go through it and add data to the table.
      if data:
          self.tblSummary.setRowCount(len(data))
          for i, row in enumerate(data):
              for j, col in enumerate(row):
                  item = QTableWidgetItem(str(col))
                  item.setFont(font)
                  #item.setForeground(QColor.fr
                  #item.setFlags(Qt.ItemIsEditable)
                  if item.text() == "None":
                      item.setText("")
                  self.tblSummary.setItem(i, j, item)      
      else:
          self.tblSummary.setRowCount(1)
          item = QTableWidgetItem()
          item.setText("Nothing Found")
          self.tblSummary.setItem(0, 0, item)
开发者ID:Ink-Pixi,项目名称:problem_sheet_viewer,代码行数:27,代码来源:main_report.py

示例9: __init__

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
 def __init__(self):
     super().__init__()
     
     self.setGeometry(600, 200, 420, 320)
     self.setWindowTitle('Help')
     self.setWindowIcon(QIcon(ICON_PATH))
     
     label = QLabel('Press anything on your keyboard to see what it does.')
     self.actionLabel = QLabel('Press something!')
     self.img = QLabel('img', self)
     self.img.setPixmap(QPixmap(HELP_IMG_PATH))
     
     
     grid = QGridLayout()
     grid.setSpacing(4)
     
     grid.addWidget(self.img, 0, 0)
     grid.addWidget(label, 1, 0)
     grid.addWidget(self.actionLabel, 2, 0)
     
     myFont=QFont()
     myFont.setBold(True)
     myFont.setPixelSize(24)
     self.actionLabel.setFont(myFont)
     
     palette = QPalette()
     palette.setColor(QPalette.Foreground,Qt.green)
     self.actionLabel.setPalette(palette)
     
     self.setLayout(grid)
     self.show()
开发者ID:chatper,项目名称:kodi-remote,代码行数:33,代码来源:HelpDialog.py

示例10: init

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
	def init(self):
		self.cpus=multiprocessing.cpu_count()
		
		self.tab.setTabsClosable(True)
		self.tab.setMovable(True)
		self.tab.setTabBar(QHTabBar())
		self.tab.setTabPosition(QTabWidget.West)
		
		self.font = QFont()
		self.font.setFamily('Monospace')
		self.font.setStyleHint(QFont.Monospace)
		self.font.setFixedPitch(True)
		self.font.setPointSize(int(12))

		self.terminals=[]
		self.process=[]
		for i in range(0,self.cpus):
			term=QTextEdit()
			term.setFont(self.font)
			
			pal = QPalette()
			bgc = QColor(0, 0, 0)
			pal.setColor(QPalette.Base, bgc)
			textc = QColor(230, 230, 230)
			pal.setColor(QPalette.Text, textc)
			term.setPalette(pal)

			proc=QProcess(self)
			proc.readyRead.connect(functools.partial(self.dataReady,i))
			self.process.append(proc)
			self.terminals.append(term)
			self.tab.addTab(term,"cpu "+str(i))
开发者ID:roderickmackenzie,项目名称:gpvdm,代码行数:34,代码来源:tab_terminal.py

示例11: set_pen_color

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
 def set_pen_color(self, label):
     color = QColorDialog.getColor()
     if color.isValid():
         self.pen = QPen(color, self.pen.width())
         label_palette = QPalette()
         label_palette.setColor(QPalette.WindowText, color)
         label.setPalette(label_palette)
         label.setText("Цвет линии " + color.name())
     self.update()
开发者ID:katya-malyk,项目名称:sphere_approximation,代码行数:11,代码来源:render_area.py

示例12: set_faces_color

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
 def set_faces_color(self, label):
     color = QColorDialog.getColor()
     if color.isValid():
         self.faces_color = color
         label_palette = QPalette()
         label_palette.setColor(QPalette.WindowText, color)
         label.setPalette(label_palette)
         label.setText("Цвет объекта " + color.name())
     self.update()
开发者ID:katya-malyk,项目名称:sphere_approximation,代码行数:11,代码来源:render_area.py

示例13: __init__

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
    def __init__(self, parent = None):

        QWidget.__init__(self, parent)
        palette = QPalette(self.palette())
        palette.setColor(palette.Background, Qt.transparent)
        self.setPalette(palette)
        self.MINCOUNTER = 10

        self.minloopkeep = False
开发者ID:lycying,项目名称:seeking,代码行数:11,代码来源:overlay.py

示例14: Monitor

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
class Monitor(QLabel):
	def __init__(self, parent):
		QLabel.__init__(self, '[ Mon ]', parent)
		self.setAutoFillBackground(True)

	def setColor(self, r, g, b):
		self.palette = QPalette()
		self.palette.setColor(QPalette.Background, QColor(round(r*255), round(g*255), round(b*255)))
		self.setPalette(self.palette)
开发者ID:ledalert,项目名称:led-nekrosfilm-sw,代码行数:11,代码来源:ljusbord.py

示例15: initUI

# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import setColor [as 别名]
    def initUI(self):
        self.viewer_layout = QVBoxLayout()
        horizontal_layout = QHBoxLayout()

        viewer_widget_palette = QPalette()
        viewer_widget_palette.setColor(QPalette.Background, QColor(constants.defaultViewerColor))
        self.setAutoFillBackground(True)
        self.setPalette(viewer_widget_palette)

        horizontal_layout.addLayout(self.viewer_layout)
        self.setLayout(horizontal_layout)
开发者ID:AlexeiBuzuma,项目名称:Coursework,代码行数:13,代码来源:custom_widgets.py


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