title: How do I pass variables from Qthread to MainWindow? (PyQt6)
body: <p>I have a process (a websocket) running in a Qthread class. What I want to do now is to edit some GUI items to be able to print the data im receiving. Since you should only edit widgets from the main class, I was thinking about sending variables from the thread to MainWindow. However, ive been failing at it, even after following some other posts here.</p>
  <p>so far my post looks like this:</p>
  <pre><code>class Worker(QObject):
      finished = pyqtSignal()
      progress = pyqtSignal(int)
  
      def __init__(self, parent = None):
          # Inherits a variable from the main window 
  
      def run(self):
          # websocket function goes here
          self.finished.emit()
  </code></pre>
  <p>and then in my main class I have:</p>
  <p>class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
  # Functions related to the class</p>
  <pre><code>def runLongTask(self):
      self.thread = QThread()
      self.worker = Worker(self.symbol)
      self.worker.moveToThread(self.thread)
      self.thread.started.connect(self.worker.run)
      self.worker.finished.connect(self.thread.quit)
      self.worker.finished.connect(self.worker.deleteLater)
      self.thread.finished.connect(self.thread.deleteLater)
      self.thread.start()
  </code></pre>