title: Accessing a PyQT widget outside it's class
body: <p>a simple situation is proving fairly tricky.</p>
  
  <p>My target is to get a window to update the status of a widget in another window.
  To explain:</p>
  
  <p>I have window A with some "data" and I want it written into the textEdit widget of window B. The specifics of the main window and the widgets are </p>
  
  <pre><code>class MainWin(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(_fromUtf8("MainWindow"))
          MainWindow.resize(1127, 880)
  
          self.centralwidget = QtGui.QWidget(MainWindow)
          self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
          self.textEdit = QtGui.QTextEdit(self.centralwidget)
          self.textEdit.setGeometry(QtCore.QRect(20, 150, 1081, 661))
          self.textEdit.setObjectName(_fromUtf8("textEdit"))
          self.textEdit.isUndoRedoEnabled ()
  </code></pre>
  
  <p>What I am currently failing at obtaining is a simple method which called from another window (and another file) could change the content inside the textEdit.
  Not sure what I am doing wrong, but when I do try to import the class or a method from the class I always seem to have issue with the </p>
  
  <blockquote>
    <p>TypeError: unbound method updEdit() must be called with
    MainWin instance as first argument (got nothing instead)</p>
  </blockquote>
  
  <p>I am very much open to suggestions, and thanks in advance!</p>
  
  <p><strong>Edit #1</strong></p>
  
  <p>from file Rep.py (the second window I am simply calling)</p>
  
  <pre><code>def addTemplate(self):
          data = self.textBrowser.toPlainText()
          MainWin.MainWin.addText(MainWindow.MainWin,data)
          self.close()
  </code></pre>
  
  <p>From the first window, all I would need to do is:</p>
  
  <pre><code>def addText(self,data):
      self.textEdit.setText(data)
  </code></pre>
  
  <p>I am fairly new to OOP so please forgive me if there's some rather stupid mistake.</p>