예제 #1
0
 def paintEvent(self, event):
     super(AttachmentLabel, self).paintEvent(event)
     if self.text() != '':
         painter = QtGui.QPainter(self)
         painter.drawLine(QtCore.QPoint(0,
                                        self.height() - 1),
                          QtCore.QPoint(self.width(),
                                        self.height() - 1))
예제 #2
0
 def paintEvent(self, event):
     painter = QtGui.QPainter(self)
     painter.setPen(QtCore.Qt.NoPen)
     painter.setBrush(
         QtGui.QBrush(
             QtGui.QColor(self.text_color.red(), self.text_color.green(),
                          self.text_color.blue(), 20)))
     painter.drawRoundedRect(0, 0, self.width(), self.height(), 5, 5)
     super(_BaseNoteWidget, self).paintEvent(event)
예제 #3
0
    def paintEvent(self, event):
        if self.pixmap() is not None:
            painter = QtGui.QPainter(self)
            painter.setRenderHints(QtGui.QPainter.Antialiasing, True)

            path = QtGui.QPainterPath()
            path.addEllipse(0, 0, self.width(), self.height())
            painter.setClipPath(path)

            painter.drawPixmap(0, 0, self.pixmap())
예제 #4
0
 def paintEvent(self, qpaintevent):
     painter = QtGui.QPainter(self)
     font = painter.font()
     fm = QtGui.QFontMetrics(font)
     w = fm.boundingRect(self.text()).width() + 10
     h = fm.boundingRect(self.text()).height()
     painter.setFont(font)
     # painter.setPen(QtGui.QPen(QtGui.QColor(10, 10, 10)))
     painter.drawText(0, 0, w, h, 0, self.text())
     super(Label, self).paintEvent(qpaintevent)