Ejemplo n.º 1
0
 def paintEvent(self, event):
     super(LineEdit, self).paintEvent(event)
     painter = QPainter(self)
     pen = QPen(self.lineHintColor)
     pen.setWidth(self.borderWidth)
     painter.setPen(pen)  # draw bottom line(画底部横线)
     #painter.drawLine(self.rect().bottomLeft(), self.rect().bottomRight())
     painter.drawLine(0, self.height(), self.width(), self.height())
     if not self.isEnabled() or self.isReadOnly():
         return
     LineEffect._paintEvent(self, painter)
Ejemplo n.º 2
0
 def setDisabled(self, enable):
     super(LineEdit, self).setDisabled(enable)
     LineEffect._setDisabled(self, enable)
Ejemplo n.º 3
0
 def setReadOnly(self, only):
     super(LineEdit, self).setReadOnly(only)
     LineEffect._setEnabled(self, False)
Ejemplo n.º 4
0
 def focusOutEvent(self, event):
     super(LineEdit, self).focusOutEvent(event)
     LineEffect._focusOutEvent(self, event)
Ejemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     super(LineEdit, self).__init__(*args, **kwargs)
     self.borderWidth = 4
     LineEffect.__init__(self)
     # 去掉边框
     self.setFrame(QFrame.NoFrame)