title: pyqt app crashing when function is executed
body: <p>i wanted to make an rpc changer with pypresence and pyqt and its working, but it crashes whenever i run function that updates the presence - no errors, no exit codes it says that app doesnt respond.
  i tried to use qt threading but it didnt work i also tried making it just a normal function, not a loop and it didnt work either.
  any ideas?
  and heres the code:</p>
  <pre><code>from pypresence import Presence 
  import time
  
  from PyQt5 import QtCore, QtGui, QtWidgets
  
  start = int(time.time())
  client_id = &quot;997609359427260416&quot;
  RPC = Presence(client_id)
  RPC.connect()
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(&quot;MainWindow&quot;)
          MainWindow.resize(485, 425)
          MainWindow.setStyleSheet(&quot;background-color: #1f1f1f;&quot;&quot;font: 75 8pt \&quot;Arial\&quot;;&quot;)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName(&quot;centralwidget&quot;)
          self.pushButton = QtWidgets.QPushButton(self.centralwidget, clicked = lambda: self.onclick())
          self.pushButton.setGeometry(QtCore.QRect(160, 350, 161, 51))
          self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
          self.pushButton.setAutoFillBackground(False)
          self.pushButton.setStyleSheet(&quot;background-color: #a30b00;&quot;&quot;color: white;&quot;&quot;transition: 0.25s;&quot;&quot;font: 12pt;&quot;&quot;border-radius: 8px;&quot;&quot;&quot;)
          self.pushButton.setObjectName(&quot;pushButton&quot;)
          self.label = QtWidgets.QLabel(self.centralwidget)
          self.label.setGeometry(QtCore.QRect(120, 10, 251, 31))
          self.label.setStyleSheet(&quot;color: white;&quot;&quot;font: 18pt&quot;)
          self.label.setObjectName(&quot;label&quot;)
          self.label_2 = QtWidgets.QLabel(self.centralwidget)
          self.label_2.setGeometry(QtCore.QRect(210, 40, 91, 16))
          self.label_2.setStyleSheet(&quot;color: #a30b00;&quot;&quot;font: 12pt&quot;)
          self.label_2.setObjectName(&quot;label_2&quot;)
          self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
          self.lineEdit.setGeometry(QtCore.QRect(80, 100, 321, 31))
          self.lineEdit.setStyleSheet(&quot;background-color: rgb(44, 44, 44);&quot;&quot;border: 2px solid rgb(60, 60, 60);&quot;&quot;border-radius: 5px;&quot;&quot;color: white;&quot;)
          self.lineEdit.setObjectName(&quot;lineEdit&quot;)
          self.label_3 = QtWidgets.QLabel(self.centralwidget)
          self.label_3.setGeometry(QtCore.QRect(80, 80, 121, 16))
          self.label_3.setStyleSheet(&quot;color: white;&quot;&quot;font-size: 12pt&quot;)
          self.label_3.setObjectName(&quot;label_3&quot;)
          self.lineEdit_2 = QtWidgets.QLineEdit(self.centralwidget)
          self.lineEdit_2.setGeometry(QtCore.QRect(80, 170, 321, 31))
          self.lineEdit_2.setStyleSheet(&quot;background-color: rgb(44, 44, 44);&quot;&quot;border: 2px solid rgb(60, 60, 60);&quot;&quot;border-radius: 5px;&quot;&quot;color: white;&quot;)
          self.lineEdit_2.setObjectName(&quot;lineEdit_2&quot;)
          self.label_4 = QtWidgets.QLabel(self.centralwidget)
          self.label_4.setGeometry(QtCore.QRect(80, 150, 121, 16))
          self.label_4.setStyleSheet(&quot;color: white;&quot;&quot;font-size: 12pt&quot;)
          self.label_4.setObjectName(&quot;label_4&quot;)
          self.lineEdit_3 = QtWidgets.QLineEdit(self.centralwidget)
          self.lineEdit_3.setGeometry(QtCore.QRect(80, 230, 321, 31))
          self.lineEdit_3.setStyleSheet(&quot;background-color: rgb(44, 44, 44);&quot;&quot;border: 2px solid rgb(60, 60, 60);&quot;&quot;border-radius: 5px;&quot;&quot;color: white;&quot;)
          self.lineEdit_3.setObjectName(&quot;lineEdit_3&quot;)
          self.label_5 = QtWidgets.QLabel(self.centralwidget)
          self.label_5.setGeometry(QtCore.QRect(80, 210, 121, 16))
          self.label_5.setStyleSheet(&quot;color: white;&quot;&quot;font-size: 12pt&quot;)
          self.label_5.setObjectName(&quot;label_5&quot;)
          self.lineEdit_4 = QtWidgets.QLineEdit(self.centralwidget)
          self.lineEdit_4.setGeometry(QtCore.QRect(80, 290, 321, 31))
          self.lineEdit_4.setStyleSheet(&quot;background-color: rgb(44, 44, 44);&quot;&quot;border: 2px solid rgb(60, 60, 60);&quot;&quot;border-radius: 5px;&quot;&quot;color: white;&quot;)
          self.lineEdit_4.setObjectName(&quot;lineEdit_4&quot;)
          self.label_6 = QtWidgets.QLabel(self.centralwidget)
          self.label_6.setGeometry(QtCore.QRect(80, 270, 121, 16))
          self.label_6.setStyleSheet(&quot;color: white;&quot;&quot;font-size: 12pt&quot;)
          self.label_6.setObjectName(&quot;label_6&quot;)
          MainWindow.setCentralWidget(self.centralwidget)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def onclick(self):
          value1 = self.lineEdit.text()
          while True:
              RPC.update(
                      large_image = &quot;large&quot;, #name of your asset
                      large_text = &quot;test&quot;,
                      details = value1,
                      state = &quot;Presence Changer&quot;,
                      start = start,
                      buttons = [{&quot;label&quot;: &quot;kndxiu on TikTok&quot;, &quot;url&quot;: &quot;https://tiktok.com/@kndxiu&quot;}, {&quot;label&quot;: &quot;Website&quot;, &quot;url&quot;: &quot;https://kndxiu.xyz&quot;}] #up to 2 buttons
              )
              time.sleep(100)
      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;SAVE&quot;))
          self.label.setText(_translate(&quot;MainWindow&quot;, &quot;Discord RP Changer&quot;))
          self.label_2.setText(_translate(&quot;MainWindow&quot;, &quot;by kndxiu.&quot;))
          self.label_3.setText(_translate(&quot;MainWindow&quot;, &quot;test&quot;))
          self.label_4.setText(_translate(&quot;MainWindow&quot;, &quot;test&quot;))
          self.label_5.setText(_translate(&quot;MainWindow&quot;, &quot;test&quot;))
          self.label_6.setText(_translate(&quot;MainWindow&quot;, &quot;test&quot;))
  
  
  if __name__ == &quot;__main__&quot;:
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>