其他分享
首页 > 其他分享> > Qt--自定义LineEdit实现点击信号

Qt--自定义LineEdit实现点击信号

作者:互联网

from PyQt5 import QtCore
from PyQt5.QtWidgets import QLineEdit

class MyLineEdit(QLineEdit):
  click = QtCore.pyqtSingal()  #自定义点击触发信号
  enter = QtCore.pyqtSingal()  #自定义鼠标移入则触发信号
  def __init__(self,parent=None):
    super(MyLineEdit,self).__init__(parent)

  def mousePressEvent(self,MouseEvent):
    self.clicked.emit()

  def enterEvent(self):
    self.enter.emit()

标签:__,Qt,自定义,--,self,PyQt5,QtCore,def
来源: https://www.cnblogs.com/tingshu/p/16054851.html