diff options
author | Christian Stenger <christian.stenger@qt.io> | 2023-06-01 15:26:34 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2023-06-02 10:42:02 +0000 |
commit | d9e3d32a80497fbef98073b06f1eaf9bf5811587 (patch) | |
tree | 2cce1d1d443cdac23d579f99a431019490dd85ae /src/plugins/texteditor/markdowneditor.cpp | |
parent | 83c837049db79e3047e7fe9c3bfbc7a0d9bd6302 (diff) |
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>
Diffstat (limited to 'src/plugins/texteditor/markdowneditor.cpp')
-rw-r--r-- | src/plugins/texteditor/markdowneditor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index 12e60f027af..9c89636df8e 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -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; |