title: Qt - updating main window with second thread
body: <p>i have an multithreaded qt application. when i am doing some processes in mainwindow.cpp, at the same time, i want to update mainwindow.ui from other thread.</p>
  
  <p>i have mythread.h</p>
  
  <pre><code>#ifndef MYTHREAD_H
  #define MYTHREAD_H
  #include &lt;QThread&gt;
  #include "mainwindow.h"
  
  class mythread : public QThread
  {
      public:
          void run();
          mythread( MainWindow* ana );
       MainWindow* ana;
  private:
  
  };
  
  #endif // MYTHREAD_H
  </code></pre>
  
  <p>mythread.cpp</p>
  
  <pre><code>mythread::mythread(MainWindow* a)
  {
      cout &lt;&lt; "thread created" &lt;&lt; endl;
          ana = a;
  }
  
  void mythread::run()
  {
      QPixmap i1 (":/notes/pic/4mdodiyez.jpg");
      QLabel *label = new QLabel();
      label-&gt;setPixmap(i1);
      ana-&gt;ui-&gt;horizontalLayout_4-&gt;addWidget(label);
  
  
  }
  </code></pre>
  
  <p>but the problem is that, i cannot reach the <code>ana-&gt;ui-&gt;horizontalLayout_4-&gt;addWidget(label);</code></p>
  
  <p>how can i do that?</p>