title: Maya 2018 Python+QT: Querying Value of Imported TextField
body: <p>I've been following <a href="http://www.janpijpers.com/qt-and-maya-how-to-use-a-qt-designer-ui-with-maya-no-pyqt/" rel="nofollow noreferrer">This Tutorial</a> on using a .UI file from QT designer in a Maya plugin. It states that, in order to query the value of a QtextEdit field after the UI has been loaded into Maya, I need to do the following:</p>
  
  <blockquote>
    <p>So now when we load our QT Ui inside of maya we can query the text of
    our line edit every time we want to by using the following line of
    code:</p>
    
    <p><code>pm.textField('textFieldName', query = True, text = True)</code></p>
  </blockquote>
  
  <p>However I can't seem to get this to function. I'm loading the UI as follows:</p>
  
  <pre><code># Load our window and put it into a variable.
  ebWin = cmds.loadUI(uiFile = self.BE_UIpath)
  </code></pre>
  
  <p>No issues there, when I try cmds.showWindow(ebWin), everything works and looks exactly as intended. Now, when I try to query the QtextEdit I've named 'exportDirectoryTF', Maya insists it does not exist. I've tried two different approaches:</p>
  
  <p>approach A:</p>
  
  <pre><code># Connect Functions to the buttons.
  exportDir = ebWin.textField('exportDirectoryTF', query = True, text = True)
  </code></pre>
  
  <p>which outputs:</p>
  
  <pre><code># Error: 'unicode' object has no attribute 'textField'
  # # Traceback (most recent call last):
  # #   File "C:/Users/Censored/Documents/maya/2018/plug-ins/EB_pi_cmds.py", line 39, in doIt
  # #     exportDir = ebWin.textField('exportDirectoryTF', query = True, text = True)
  # # AttributeError: 'unicode' object has no attribute 'textField'
  </code></pre>
  
  <p>and approach B:</p>
  
  <pre><code>import maya.cmds as cmds
  # Connect Functions to the buttons.
  exportDir = cmds.textField('exportDirectoryTF', query = True, text = True)
  </code></pre>
  
  <p>which returns:</p>
  
  <pre><code># RuntimeError: Object 'exportDirectoryTF' not found.
  # # Traceback (most recent call last):
  # #   File "C:/Users/Censored/Documents/maya/2018/plug-ins/EB_pi_cmds.py", line 39, in doIt
  # #     exportDir = cmds.textField('exportDirectoryTF', query = True, text = True)
  # # RuntimeError: Object 'exportDirectoryTF' not found. # 
  </code></pre>
  
  <p>The tutorial has 'pm.textField('textFieldName', q = True, text = True)', and I can't figure out where the "pm" came from, if it is supposed to indicate the variable from loading the UI or the maya Python textField command, or neither. </p>
  
  <p>If anyone could point me in the right direction here, it would be greatly appreciated. </p>