MarkdownEditor: Ensure focus is inside the editor part

When loading a file it is more likely that the editable view
of the document should be focused than the read only part.

Change-Id: I8b7ed40a233dedf94883072be7462ebeabb78b42
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2023-06-01 15:26:34 +02:00
parent 83c837049d
commit d9e3d32a80

View File

@@ -245,6 +245,8 @@ public:
if (obj == m_widget && ev->type() == QEvent::FocusIn) {
if (m_splitter->focusWidget())
m_splitter->focusWidget()->setFocus();
else if (m_textEditorWidget->isVisible())
m_textEditorWidget->setFocus();
else
m_splitter->widget(0)->setFocus();
return true;