本文整理汇总了Python中PyQt5.QtGui.QPalette.link方法的典型用法代码示例。如果您正苦于以下问题:Python QPalette.link方法的具体用法?Python QPalette.link怎么用?Python QPalette.link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui.QPalette
的用法示例。
在下文中一共展示了QPalette.link方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _highlightHeaders
# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import link [as 别名]
def _highlightHeaders(self, c, r):
p = QPalette()
for i in range(self.columnCount()):
col = self.horizontalHeaderItem(i)
if i == c:
col.setIconAndTextColor(p.link().color())
else:
col.setIconAndTextColor(p.text().color())
for j in range(self.rowCount()):
row = self.verticalHeaderItem(j)
if j == r:
row.setIconAndTextColor(p.link().color())
else:
row.setIconAndTextColor(p.text().color())
示例2: updateFilledCircle
# 需要导入模块: from PyQt5.QtGui import QPalette [as 别名]
# 或者: from PyQt5.QtGui.QPalette import link [as 别名]
def updateFilledCircle(self, s):
size = s * self.zoom
pixmap = QPixmap(self.width(), self.height())
pixmap.fill(Qt.transparent)
#painter filled ellipse
p = QPalette()
painter = QPainter()
painter.begin(pixmap)
painter.setRenderHint(QPainter.Antialiasing)
brush = QBrush(p.link().color())
painter.setBrush(brush)
painter.setOpacity(0.4)
painter.drawEllipse(QRect(old_div(self.width(),2) - old_div(size,2), old_div(self.height(),2) - old_div(size,2), size, size))
painter.end()
#painter ellipse 2
painter2 = QPainter()
painter2.begin(pixmap)
painter2.setRenderHint(QPainter.Antialiasing)
pen2 = QPen(Qt.green)
pen2.setWidth(1)
painter2.setPen(pen2)
painter2.drawEllipse(QRect(old_div(self.width(),2) - old_div(size,2), old_div(self.height(),2) - old_div(size,2), size, size))
painter2.end()
self.ellipseLabel.setPixmap(QPixmap(pixmap))
self.lastSize = s