Esempio n. 1
0
 def paintEvent(self, event):
     painter = QPainter()
     painter.begin(self)
     painter.setBrush(QColor(192, 192, 192))
     painter.setPen(QColor(64, 64, 64))
     painter.drawPolygon(self._arrow)
     painter.end()
 def paintEvent(self, event):
     super(CommandButton, self).paintEvent(event)
     if self.has_menu:
         painter = QPainter()
         painter.begin(self)
         brush = QBrush(QColor(self.theme().accent_color))
         painter.setRenderHint(painter.Antialiasing)
         painter.setBrush(brush)
         painter.setPen(Qt.NoPen)
         w = self.rect().width() - 1
         h = self.rect().height() - 1
         polygon = QPolygon()
         polygon.append(QPoint(w - 1, h - 8))
         polygon.append(QPoint(w - 8, h - 1))
         polygon.append(QPoint(w - 1, h - 1))
         painter.drawPolygon(polygon)