put the caret in the name prompt's line edit

The layer asked the modal's focusWidget() what to focus, but hosting a
modal reparents it into a scroll area and a reparent clears the focus its
constructor set, so the answer was always nothing and the dialog itself
took the keyboard. Modals now name their initial focus widget outright,
which survives the hosting.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
This commit is contained in:
2026-08-18 22:05:28 +02:00
parent 1ffacae2fb
commit b7fe5cfcf2
5 changed files with 26 additions and 8 deletions

View File

@@ -52,6 +52,11 @@ bool ModalDialog::isDismissible() const
return false;
}
QWidget* ModalDialog::getInitialFocusWidget() const
{
return nullptr;
}
void ModalDialog::requestDismiss()
{
reject();