function inptxt(){ var dialog = new QDialog(this); dialog.title = "Input text"; var fbox = new QFormLayout; var stxt = new QLineEdit; stxt.returnPressed.connect(function() { //doesn't work return stxt.text; }); fbox.addRow(stxt); dialog.setLayout(fbox); if (dialog.exec()) { } return stxt.text; }Does anyone know why the connect function doesn't work?
Thanks very much in advance