title: PyQt QueuedConnection sometimes works
body: <p>I have an application using QThreads. I am adding different methods to a queued connection and they are run in that sequence. This has been working very well. But the depending on the order of the tests (sequence can be in any order) my application will just stop (It won't freeze, but it won't finish calling the rest of the tests in the queue). For example if running the sequence [test1, test2, test3]. I will be able to run and finish (finish signal is emitted) test1 and test2, but test3 will not be called. However, this only happens sometimes, not all the time. I think the thread is quitting before all the tasks are complete. Is there something I should be clearing?</p>
  
  <p>Relevant code below:</p>
  
  <pre><code>    # Initialize QThread
      self.obj = signalTest.Worker()
      self.thread = QThread()
      self.obj.moveToThread(self.thread)
      self.obj.finished.connect(self.signalFinished)
  
  def runTests(self) # This is triggered by clicking a button
      self.thread.start()
      for index in range(0, len(sequence)):
          if self.queue[index] == 'test1'
              QMetaObject.invokeMethod(self.obj, 'run_test1', Qt.QueuedConnection,
                                       Q_ARG(int, index)
          elif self.queue[index] == 'test2'
              QMetaObject.invokeMethod(self.obj, 'run_test2', Qt.QueuedConnection)
          elif self.queue[index] == 'test3'
              QMetaObject.invokeMethod(self.obj, 'run_test3', Qt.QueuedConnection)
  
  @pyqtSlot(int)
  def signalFinished(self, row)
      # Do something here
  </code></pre>
  
  <p>Worker thread:</p>
  
  <pre><code>class Worker(QObject):
      finished = pyqtSignal(int)
  
      @pyqtSlot(int)
      def test1(self):
          """
          Runs test1
          """
          if self.abort is False:
              # Run test1 here
          self.finished.emit(row)
  ....
  </code></pre>