import sys from PySide import QtCore from PySide import QtGui class MyDialog(QtGui.QDialog): def __init__(self, parent=None): super(MyDialog, self).__init__(parent) boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.TopToBottom, self) self.lineedit = QtGui.QLineEdit() boxlayout.addWidget(self.lineedit) self.button = QtGui.QPushButton("Abschicken") self.button.clicked.connect(self.buttonClicked) boxlayout.addWidget(self.button) self.label = QtGui.QLabel() boxlayout.addWidget(self.label) self.setLayout(boxlayout) def buttonClicked(self): self.label.setText(self.lineedit.text()) self.lineedit.setText("") if __name__ == "__main__": app = QtGui.QApplication(sys.argv) dialog = MyDialog() sys.exit(dialog.exec_())