forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user