title: QObject: Cannot create children for a parent that is in a different thread
body: <p><strong>EDIT:</strong></p>
  
  <p>I tried doing what you guys told me in comments ... :</p>
  
  <pre><code>Citizen * c = new Citizen(this);
  
  QThread thread;
  c-&gt;moveToThread(&amp;thread);
  
  connect(&amp;thread, SIGNAL(started()), c, SLOT(ProcessActions()));
  thread.start();
  </code></pre>
  
  <p>This produces even more errors:</p>
  
  <pre><code>QThread: Destroyed while thread is still running
  ASSERT failure in QThread::setTerminationEnabled(): "Current thread was not started with QThread.", file c:\ndk_buildrepos\qt-desktop\src\corelib\thread\qthread_win.cpp, line 542
  Invalid parameter passed to C runtime function.
  Invalid parameter passed to C runtime function.
  QObject::killTimers: timers cannot be stopped from another thread
  </code></pre>
  
  <p>I am having problems with this error ... I'm stuck on this for 2 days already and can't get a solution.</p>
  
  <p><em>Header:</em></p>
  
  <pre><code>class Citizen : public QThread
  {
  Q_OBJECT    
      QNetworkAccessManager * manager;
  
  private slots:
      void onReplyFinished(QNetworkReply* net_reply);
  
  public:
      Citizen(QObject * parent);
  
      void run();
  };
  </code></pre>
  
  <p><em>Implementation:</em></p>
  
  <pre><code>Citizen::Citizen(QObject * parent)
  {
      manager = new QNetworkAccessManager;
      connect(_net_acc_mgr, SIGNAL(finished(QNetworkReply*)),
              this, SLOT(onReplyFinished(QNetworkReply*)));
  }
  
  void Citizen::onReplyFinished(QNetworkReply* net_reply)
  {
      emit onFinished(net_reply);
  }
  
  void Citizen::run()
  {
      manager-&gt;get(QNetworkRequest(QUrl("http://google.com"));
  
      QEventLoop eLoop;
      connect(manager, SIGNAL( finished( QNetworkReply * ) ), &amp;eLoop, SLOT(quit()));
      eLoop.exec(QEventLoop::ExcludeUserInputEvents);
  
      qDebug() &lt;&lt; "loaded google!";
  
      exec();
  }
  </code></pre>
  
  <p>When manager->get() gets executed, I get the following error:</p>
  
  <pre><code>QObject: Cannot create children for a parent that is in a different thread.
  (Parent is QNetworkAccessManager(0xc996cf8), parent's thread is QThread(0xaba48d8), current thread is Citizen(0xca7ae08)
  </code></pre>
  
  <p>When eLoop.exec() gets executed:</p>
  
  <pre><code>QObject::startTimer: timers cannot be started from another thread
  </code></pre>
  
  <p>I start this thread in the following manner:</p>
  
  <pre><code>Citizen * c = new Citizen(this);
  c-&gt;start();
  </code></pre>
  
  <p>Why does this happen? How to solve this?</p>