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())
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(self.width() / 2 - size / 2, self.height() / 2 - 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(self.width() / 2 - size / 2, self.height() / 2 - size / 2, size, size)) painter2.end() self.ellipseLabel.setPixmap(QPixmap(pixmap)) self.lastSize = s
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(self.width()/2 - size/2, self.height()/2 - 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(self.width()/2 - size/2, self.height()/2 - size/2, size, size)) painter2.end() self.ellipseLabel.setPixmap(QPixmap(pixmap)) self.lastSize = s