title: PyQt4 edit QLineEdit and keep the text
body: <p>Following code creates a Widget with a Button and a LineEdit:</p>
  
  <pre><code>import sys
  from PyQt4.QtGui import QApplication, QMainWindow, QPushButton, QLineEdit, QLabel, QComboBox, QProgressBar, QFileDialog
  from PyQt4.QtCore import QSize, pyqtSlot
  
  class App(QMainWindow):
  
      def __init__(self):
          super(App, self).__init__()
          self.setGeometry(500, 300, 820, 350)
          self.setWindowTitle("Widget")
          self.initUI()
  
      def initUI(self):
  
          #Buttons
          btnposx = 30
          btnposy = 50
  
  
          leposx = 150
          leposy = btnposy
  
          self.le = QLineEdit(self)
          self.le.move(leposx,leposy)
          self.le.resize(630,26)
  
          self.btn = QPushButton('Save',self)
          self.btn.move(btnposx,btnposy)
          self.btn.clicked.connect(self.edit_le)
  
  
          self.show()
  
      def edit_le(self):
          self.le.setText('hello')
  
  
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      ex = App()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>Further with a push on the Button, the LineEdit is filled with 'hello'. Is there a way to Keep the 'hello' string, even if the Widget gets closed?</p>
  
  <p>Edit: </p>
  
  <p>Thank you for the dublicate link eyllanesc. Unfortunately the example code provided in this thread does not seem to work. I adapted it for PyQt4 but it just does not save anything. I am using Spyder.</p>