title: I'm getting error in pyqt5, while connecting push button
body: <p>I'm first time using pyqt5. After creating the UI from QT designer, and then converting the UI file to python file, I'm getting error, the strange part is sometimes when i try to recreate the UI from Designer i don't get the error, but sometimes with same code line by line, I get this error. Maybe I'm doing something wrong in the qt designer, I don't know what is wrong.</p>
  <blockquote>
  <p>QObject::connect: Cannot connect QPushButton::clicked(bool) to (null)::browse_slot()</p>
  <p>TypeError: connect() failed between clicked(bool) and browse_slot()</p>
  </blockquote>
  <p>MY CODE :</p>
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  from PyQt5.QtWidgets import QApplication, QMainWindow
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(&quot;MainWindow&quot;)
          MainWindow.resize(640, 480)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName(&quot;centralwidget&quot;)
          self.pushButton = QtWidgets.QPushButton(self.centralwidget)
          self.pushButton.setGeometry(QtCore.QRect(280, 200, 89, 25))
          self.pushButton.setObjectName(&quot;pushButton&quot;)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 640, 22))
          self.menubar.setObjectName(&quot;menubar&quot;)
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName(&quot;statusbar&quot;)
          MainWindow.setStatusBar(self.statusbar)
          self.retranslateUi(MainWindow)
          self.pushButton.clicked.connect(self.browse_slot)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate(&quot;MainWindow&quot;, &quot;MainWindow&quot;))
          self.pushButton.setText(_translate(&quot;MainWindow&quot;, &quot;PushButton&quot;))
  
      @QtCore.pyqtSlot( )
      def browse_slot( self ):
          options = QtWidgets.QFileDialog.Options()
          options |= QtWidgets.QFileDialog.DontUseNativeDialog
          fileName, _ = QtWidgets.QFileDialog.getOpenFileName(
                          None,
                          &quot;QFileDialog.getOpenFileName()&quot;,
                          &quot;&quot;,
                          &quot;All Files (*);;Python Files (*.py)&quot;,
                          options=options)
          if fileName:
              self.debugPrint( &quot;setting file name: &quot; + fileName )
              self.model.setFileName( fileName )
              self.refreshAll()
  
  if __name__ == &quot;__main__&quot;:
      import sys
      app = QApplication(sys.argv)
      Window = QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(Window)
      Window.show()
      sys.exit(app.exec_())
  </code></pre>