Beispiel #1
0
 def paintEvent(self, event):
     painter = QPainter(self)
     mode = QIcon.Active if self.isDown() else QIcon.Normal
     pixmap = self.icon.pixmap(self._size, mode)
     painter.drawPixmap(
         QPoint(0, 0), pixmap.scaled(event.rect().size(),
                                     Qt.KeepAspectRatio))
Beispiel #2
0
 def paintEvent(self, ev):
     if self._background_image:
         # draw background image if any (should be mostly transparent!)
         painter = QPainter()
         painter.begin(self.viewport())
         painter.drawPixmap(self._background_image_area,
                            self._background_image)
         painter.end()
     QTextBrowser.paintEvent(self, ev)
Beispiel #3
0
    def paintEvent(self, event):
        painter = QPainter(self)

        if self.flag is False:
            painter.drawPixmap(event.rect(), self.currmap)
            self.rect = event.rect()
        else:
            pixmap = self.pixmap if self.current == 'Ell' else self.pixmap2
            painter.drawPixmap(event.rect(), pixmap)
            self.rect = event.rect()
            self.currmap = pixmap
            self.flag = False
Beispiel #4
0
 def paintEvent(self, event):
     painter = QPainter(self)
     painter.drawPixmap(event.rect(),
                        self.pixmap1 if self.isChecked() else self.pixmap2)
     event.accept()