title: QThread and Cannot set parent, new parent is in a different thread
body: <p>I tried using QThread for adding a tedious task of adding <code>QWidget</code> objects to my <code>QTreeWidget</code> as I thought QThread would have all the necessarities for such. But without luck! What I've been able to read about is that I cannot do sudden operations outside the <code>QMain</code> method but that there's a way to do it.</p>
  
  <p>Below is a <code>QThread class</code> and a <code>class</code> that adds an item to a QTreeWidget. Which it easily can. But whenever I try to add the <code>QPushUpButton</code> it'll give me an error of parenting.</p>
  
  <p>Is it impossible to achieve this with QThread? </p>
  
  <pre><code>import sys
  from PyQt4 import QtGui as qt
  from PyQt4.QtCore import QThread
  
  class YourThreadName(QThread):
  
  def __init__(self, QTreeWidget, obj):
      QThread.__init__(self)
      self.Tree = QTreeWidget
      self.obj = obj
  def __del__(self):
      self.wait()
  
  def run(self):
      item = qt.QTreeWidgetItem()
      item.setText(0, "hi")
  
      self.Tree.addTopLevelItem(item)
  
      bttn = qt.QPushButton("Graph")
      bttn.clicked.connect(self.obj.printer)
      bttn.setObjectName("Test")
  
      self.Tree.setItemWidget(item, 1, bttn)
  
  class Window(qt.QMainWindow):
  
  def __init__(self, parent=None):
      super(Window, self).__init__(parent)
  
      frameWrapper = qt.QFrame(self)    
      self.setCentralWidget(frameWrapper)
  
      self.frameAlgorithm = qt.QFrame(frameWrapper)
      self.frameAlgorithm.setGeometry(0, 0, 700, 400)
      self.faLayout = qt.QGridLayout(self.frameAlgorithm)
  
      bttn = qt.QPushButton("Add Rows", self)
      bttn.clicked.connect(self.StartThread)
      self.faLayout.addWidget(bttn, 0, 0, 1, 1)
  
      self.Tree = qt.QTreeWidget()
      self.Tree.setHeaderLabels(["Name", "Button"])
      self.faLayout.addWidget(self.Tree, 1, 0, 1, 1)
  
      self.setGeometry(600, 400, 700, 400)
      self.show()
  
  def StartThread(self):    
      qThread = YourThreadName(self.Tree, self)
      qThread.start() 
  
  def printer(self):
      print(self.sender().objName())
  
  app = qt.QApplication(sys.argv)
  w = Window()
  sys.exit(app.exec_())
  </code></pre>