diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-12-01 15:54:19 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-01-04 07:41:46 +0000 |
commit | f8f882ecdf1b3a4a87ed7dcabbd3eeedcaaf0374 (patch) | |
tree | 9526629a82a166edae97602fc3c276fc3c483df8 /src/plugins/android/androidmanifesteditorwidget.cpp | |
parent | d9bd0623255affa92061b6e8b72e47bfc736b74b (diff) | |
download | qt-creator-f8f882ecdf1b3a4a87ed7dcabbd3eeedcaaf0374.tar.gz |
Fix focus handling in android manifest editor
If focus gets set on the editor widget, either the current focus widget
of the current page (gui/text) should receive application focus, or the
page itself (where the gui page should defer that to its first input
widget).
Change-Id: I8a35c2e9ca06fe694069b594788f7f40307abbda
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Diffstat (limited to 'src/plugins/android/androidmanifesteditorwidget.cpp')
-rw-r--r-- | src/plugins/android/androidmanifesteditorwidget.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 5bcd699816..91e8a43b64 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -462,6 +462,7 @@ void AndroidManifestEditorWidget::initializePage() QScrollArea *mainWidgetScrollArea = new QScrollArea; mainWidgetScrollArea->setWidgetResizable(true); mainWidgetScrollArea->setWidget(mainWidget); + mainWidgetScrollArea->setFocusProxy(m_packageNameLineEdit); insertWidget(General, mainWidgetScrollArea); insertWidget(Source, m_textEditorWidget); @@ -477,6 +478,16 @@ bool AndroidManifestEditorWidget::eventFilter(QObject *obj, QEvent *event) return QWidget::eventFilter(obj, event); } +void AndroidManifestEditorWidget::focusInEvent(QFocusEvent *event) +{ + if (currentWidget()) { + if (currentWidget()->focusWidget()) + currentWidget()->focusWidget()->setFocus(event->reason()); + else + currentWidget()->setFocus(event->reason()); + } +} + void AndroidManifestEditorWidget::updateTargetComboBox() { Project *project = androidProject(m_textEditorWidget->textDocument()->filePath()); |