title: PyQT Accessing UI elements from other classes(Qthread) in same file
body: <p>I have seen similar questions ,but no luck from my case. I am trying to access the UI elements from other class,but 
   i am getting the following error. error in <strong>"worker_temp"</strong> function</p>
  
  <pre><code>AttributeError: 'rack_temp' object has no attribute 'ui'
  </code></pre>
  
  <p><strong>code which i tried:</strong> - <strong>main.py</strong></p>
  
  <pre><code>from PyQt5.uic.properties import QtWidgets
  from master.ui_code.fast_charging_ui import Ui_Dialog
  from PyQt5.QtWidgets import QMainWindow, QApplication, QDialog, QLabel, QMessageBox
  from PyQt5.QtCore import QTimer, QObject, pyqtSignal, QRunnable, pyqtSlot, QThreadPool, QByteArray, QEventLoop, QThread
  
  import sys
  
  class MainWindow(QDialog):
  
      def __init__(self,*args, **kwargs):
          super(MainWindow, self).__init__(*args, **kwargs)
  
          self.ui = Ui_Dialog()    
          self.ui.setupUi(self)
          self.ui.unit_1.setCurrentIndex(0)
          self.threadpool = QThreadPool()
          self.test = rack_temp()
          self.test.start()
  
  
      def door_1_check(self):
          print "door check"
  
  class rack_temp(QThread):
      def __init__(self, parent = None):
          QThread.__init__(self, parent)
          super(rack_temp, self).__init__(parent)
          self.threadpool = QThreadPool()
          self.dataCollectionTimer = QTimer()
          self.dataCollectionTimer.moveToThread(self)
          self.dataCollectionTimer.timeout.connect(self.worker_temp)
          self.worker_temp()
  
      def worker_temp(self):
          print "test "
          self.ui.unit_1.setCurrentIndex(2)
  
      def run(self):
          self.dataCollectionTimer.start(2000)
          loop = QEventLoop()
          loop.exec_()
  
  
  if __name__ == "__main__":
      app = QApplication(sys.argv)
      window = MainWindow()
      window.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>Can anyone tell me why i am not able to inherit the elements from other class?
  Thanks in Advance!</p>