PyQt4를 기반으로 PyQt를 사용하고 있습니다. PyCharm 2017.3을 사용하고 있습니다. 내 파이썬 버전은 3.4입니다.
QLineEdit에서 콘텐츠를 캡처하기 위해 마우스를 클릭 할 때 나타나는 신호를 연결하려고합니다. 내가 실행할 때AttributeError : 'builtin_function_or_method'객체에 '연결'속성이 없습니다.
class HelloWorld(QMainWindow, tD_ui.Ui_MainWindow):
# defining constructor
def __init__(self):
QMainWindow.__init__(self)
self.setupUi(self)
self.getContent()
self.putValues()
self.setWindowTitle("Downloader")
self.pushButton.mousePressEvent.connect(self.getContent)
는 그래서 code.The 다음과 같은 오류가
Traceback (most recent call last):
File "C:/Project/Downloader/Implement.py", line 113, in <module>
helloworld = HelloWorld()
File "C:/Project/Downloader/Implement.py", line 18, in __init__
self.pushButton.mousePressEvent.connect(self.getContent)
AttributeError: 'builtin_function_or_method' object has no attribute 'connect'
PS->
귀하의 솔루션 worked.Thank을 . mousePressEvent가 clicked.What func와 다른 점을 이해할 수 없습니다. 그것은 그것을 위해 예비되어 왔으며 – royatirek