title: function of pyqtSlot
body: <p>I just read a tutorial about pyqt5 button from <a href="https://pythonspot.com/en/pyqt5-buttons/" rel="noreferrer">here</a>. And the code is as below. There is a question about <code>button.clicked.connect(self.on_click)</code> and <code>@pyqtSlot()</code>. If I delete <code>@pyqtSlot()</code> from the code, it still works. However, the button does not work if I delete <code>button.clicked.connect(self.on_click)</code> from the code. So what is the function of <code>@pyqtSlot()</code> in this code? </p>
  
  <pre><code>import sys
  from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
  from PyQt5.QtGui import QIcon
  from PyQt5.QtCore import pyqtSlot
  
  class App(QWidget):
  
      def __init__(self):
          super().__init__()
          self.title = 'PyQt5 button - pythonspot.com'
          self.left = 10
          self.top = 10
          self.width = 320
          self.height = 200
          self.initUI()
  
      def initUI(self):
          self.setWindowTitle(self.title)
          self.setGeometry(self.left, self.top, self.width, self.height)
  
          button = QPushButton('PyQt5 button', self)
          button.setToolTip('This is an example button')
          button.move(100,70) 
          button.clicked.connect(self.on_click)
  
          self.show()
  
      @pyqtSlot()
      def on_click(self):
          print('PyQt5 button click')
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      ex = App()
      sys.exit(app.exec_())
  </code></pre>