title: AttributeError: 'MyMainWindow' object has no attribute 'pushButton'
body: <p>Trying to proceed click button event in my code but got some issue.</p>
  
  <pre><code>AttributeError: 'MyMainWindow' object has no attribute 'pushButton'
  </code></pre>
  
  <p>Seems, like <strong>clicked</strong> event can`t find <strong>pushbutton</strong> from my subclass. Probably i did some mistakes in syntax, so really waiting for your help guys. Sorry if the question very banal, pyQt5 is simply new for me, trying to figure out in all of this.</p>
  
  <p>Here is my files.</p>
  
  <p><strong><em>ui_main.py</em></strong></p>
  
  <pre><code>    # -*- coding: utf-8 -*-
  
  # Form implementation generated from reading ui file '1.ui'
  #
  # Created by: PyQt5 UI code generator 5.7.1
  #
  # WARNING! All changes made in this file will be lost!
  
  from PyQt5 import QtCore, QtGui, QtWidgets
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName("MainWindow")
          MainWindow.resize(349, 131)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
          self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
          self.gridLayout.setObjectName("gridLayout")
          self.formLayout = QtWidgets.QFormLayout()
          self.formLayout.setObjectName("formLayout")
          self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
          self.lineEdit.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
          self.lineEdit.setObjectName("lineEdit")
          self.formLayout.setWidget(1, QtWidgets.QFormLayout.SpanningRole, self.lineEdit)
          self.label = QtWidgets.QLabel(self.centralwidget)
          self.label.setAlignment(QtCore.Qt.AlignCenter)
          self.label.setObjectName("label")
          self.formLayout.setWidget(0, QtWidgets.QFormLayout.SpanningRole, self.label)
          self.gridLayout.addLayout(self.formLayout, 0, 0, 1, 1)
          self.horizontalLayout = QtWidgets.QHBoxLayout()
          self.horizontalLayout.setObjectName("horizontalLayout")
          self.pushButton = QtWidgets.QPushButton(self.centralwidget)
          self.pushButton.setObjectName("pushButton")
          self.horizontalLayout.addWidget(self.pushButton)
          self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
          self.pushButton_2.setObjectName("pushButton_2")
          self.horizontalLayout.addWidget(self.pushButton_2)
          self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 349, 21))
          self.menubar.setObjectName("menubar")
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName("statusbar")
          MainWindow.setStatusBar(self.statusbar)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
          self.label.setText(_translate("MainWindow", "TextLabel"))
          self.pushButton.setText(_translate("MainWindow", "PushButton"))
          self.pushButton_2.setText(_translate("MainWindow", "PushButton"))
  
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p><strong><em>py_main.py</em></strong></p>
  
  <pre><code>import sys
  from PyQt5.QtWidgets import QApplication, QMainWindow, qApp
  from PyQt5.QtCore import Qt, QEvent, QObject
  from ui_main import Ui_MainWindow
  
  
  class MyMainWindow(QMainWindow, Ui_MainWindow):
      def __init__(self, parent=None):
          super(MyMainWindow, self).__init__(parent)
          qApp.installEventFilter(self)
          self.pushButton.clicked.connect(self.clickButton()) #here is where the issue is occurs
          self.show()
          self.setupUi(self)
  
      def eventFilter(self, obj, event):
          if event.type() == QEvent.KeyPress:
              if event.key() == Qt.Key_Escape:
                  self.close()
          return super(MyMainWindow, self).eventFilter(obj, event)
  
      def clickButton(self):
          sender = self.sender()
          self.statusbar().showMessage(sender.text() + ' was pressed')
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      win = MyMainWindow()
      test = TestClass()
      sys.exit(app.exec_())
  </code></pre>
  
  <p><em>Waiting forward for your help!</em></p>