title: access inputted text from user with pyqt5
body: <p>I am trying to access inputted text from user with following code:</p>
  
  <pre><code>class Ui_Dialog(object):
      def setupUi(self, Dialog):
          self.textEdit = QtWidgets.QTextEdit()
          self.pushButton = QtWidgets.QPushButton(Dialog)
          self.mytext = self.textEdit.toPlainText()
          self.pushButton.clicked.connect(self.mainjob)
  
      def mainjob(self):
          print(self.mytext)
  </code></pre>
  
  <p>but i get empty string in result.</p>