title: PyQt4 QThread / moveToThread not working depending on context?
body: <p>I'm trying to understand why the following code immediately exits, but works if I create the thread in the main context and not in a second object?</p>
  
  <pre><code>from PyQt4 import QtCore
  import time
  import sys
  
  class SomeObject(QtCore.QObject):
  
      finished = QtCore.pyqtSignal()
  
      def longRunning(self):
          count = 0
          while count &lt; 5:
              time.sleep(1)
              print "Increasing"
              count += 1
          self.finished.emit()
  
  class SecondObject(QtCore.QObject):
      def __init__(self, app):
          QtCore.QObject.__init__(self)
          objThread = QtCore.QThread()
          obj = SomeObject()
          obj.moveToThread(objThread)
          obj.finished.connect(objThread.quit)
          objThread.started.connect(obj.longRunning)
          objThread.finished.connect(app.exit)
          objThread.start()
  
  def usingMoveToThread():
      app = QtCore.QCoreApplication([])
      SecondObject(app)
      sys.exit(app.exec_())
  
  if __name__ == "__main__":
      usingMoveToThread()
  </code></pre>
  
  <p>Thanks in Advance for any help!</p>