As there is a generic approach to hooking into the line edits
in popups, use that to also do auto-focus/auto-select-all.
_name_widget->setCurrentIndex(index);
}
- _name_widget->lineEdit()->selectAll();
- _name_widget->setFocus();
-
connect(_name_widget, SIGNAL(editTextChanged(const QString&)),
this, SLOT(on_text_changed(const QString&)));
{
QLineEdit *const name_edit = new QLineEdit(parent);
name_edit->setText(_name);
- name_edit->selectAll();
- name_edit->setFocus();
connect(name_edit, SIGNAL(textChanged(const QString&)),
this, SLOT(on_text_changed(const QString&)));
form->addRow(tr("Name"), name_edit);
keyEvent = static_cast<QKeyEvent*>(evt);
if (keyEvent->key() == Qt::Key_Enter ||
keyEvent->key() == Qt::Key_Return) {
- this->close();
+ close();
return true;
}
}
le->installEventFilter(this);
else
le->parent()->installEventFilter(this);
+
+ le->selectAll();
+ le->setFocus();
}
}