title: QlineEdit and signal & slot
body: <p>I have created a widget with <code>QLineEdit</code> and <code>QLabel</code>, I want to get input from QlineEdit and display it with <code>QLabel</code>. I have used Signal and Slot connection, I do not know what I do wrong, but it is not working correctly. I would like to get both values from <code>QLineEdit</code> and later show it. </p>
  
  <p>Current window</p>
  
  <p><img src="https://i.stack.imgur.com/Y8Mf7.png" alt="enter image description here"></p>
  
  <p>what I want?</p>
  
  <p><img src="https://i.stack.imgur.com/gM53q.png" alt="enter image description here"></p>
  
  <p>Code:</p>
  
  <pre><code>import os
  import sys
  from PyQt5 import QtCore, QtGui, QtWidgets
  
  class WinDialog(QtWidgets.QDialog):
  
      currenttextedited = QtCore.pyqtSignal(int)
  
      def __init__(self, parent=None):
          super(WinDialog, self).__init__(parent)
  
          self.setGeometry(300,300,350,300)
  
          self.setWindowTitle("Signal &amp; Slot")
  
          self.propertyWidget = PropertyWidget()
  
          section_lay = QtWidgets.QHBoxLayout()
          section_label = QtWidgets.QLabel("Name: ")
          section_edit = QtWidgets.QLineEdit('')
  
          length_lay = QtWidgets.QHBoxLayout()
          length_label = QtWidgets.QLabel("Input a number:     L = ")
          self.length_edit = QtWidgets.QLineEdit('1000')
          self.length_edit.setInputMask("999999")
          self.length_edit.setFocus(True)
  
          thick_lay = QtWidgets.QHBoxLayout()
          thick_label = QtWidgets.QLabel("Input a text: T = ")
          thick_edit = QtWidgets.QLineEdit('')
  
          section_lay.addWidget(section_label)
          section_lay.addWidget(section_edit)
  
          length_lay.addWidget(length_label)
          length_lay.addWidget(self.length_edit)
          length_lay.addStretch()
  
          thick_lay.addWidget(thick_label)
          thick_lay.addWidget(thick_edit)
          thick_lay.addStretch()
  
          VB_lay = QtWidgets.QVBoxLayout()
          VB_lay.addStretch()
          VB_lay.addLayout(length_lay)
          VB_lay.addLayout(thick_lay)
          VB_lay.addStretch()
  
          buttonBox = QtWidgets.QDialogButtonBox()
  
          buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
          |QtWidgets.QDialogButtonBox.Ok)
          buttonBox.accepted.connect(self.accept) 
          buttonBox.rejected.connect(self.reject)
  
          grid = QtWidgets.QGridLayout(self)
          grid.addLayout(section_lay, 0, 0, 1, 2)
          grid.addLayout(VB_lay, 1, 0)
          grid.addWidget(self.propertyWidget, 2, 0)
          grid.addWidget(buttonBox, 3, 0, 1, 2)
  
  
  
          self.length_edit.textEdited.connect(self.textchanged)
  
      def textchanged(self, text):
          print(text)
          self.currenttextedited.emit(text)
  
  class PropertyWidget(QtWidgets.QWidget):
      def __init__(self, parent=None):
         super(PropertyWidget, self).__init__(parent)        
         HB_lay = QtWidgets.QHBoxLayout(self)
         self.Displaylabel = QtWidgets.QLabel('')
         HB_lay.addWidget(self.Displaylabel)
         HB_lay.addStretch()
  
  
  
  @QtCore.pyqtSlot(int)
  def Display(self, text):
      try:
          L_Display = int(text)
          T_Display = int(text) 
          fmt = "L = {}mm\nT = {}mm"
          self.Displaylabel.setText(fmt.format(L_Display, T_Display))
      except ValueError:
          print("Error")        
  
  
  if __name__ == '__main__':
      app = QtWidgets.QApplication(sys.argv)
      w = WinDialog()
      w.show()
      sys.exit(app.exec_())
  </code></pre>