Skip to content
Permalink
Browse files

Automatically set focus on the line edit for attribute table filters

Because the obvious action after selecting a search field is to start
typing and not to click on the line edit with the mouse.
  • Loading branch information
m-kuhn committed Jan 20, 2017
1 parent dd61445 commit 45f4a3e8b757be8009c8a6d82e6daaab219c2628
Showing with 2 additions and 1 deletion.
  1. +1 −1 src/app/qgsattributetabledialog.cpp
  2. +1 −0 src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp
@@ -527,6 +527,7 @@ void QgsAttributeTableDialog::replaceSearchWidget( QWidget* oldw, QWidget* neww
oldw->setVisible( false );
mFilterLayout->addWidget( neww, 0, 0, 0 );
neww->setVisible( true );
neww->setFocus();
}

void QgsAttributeTableDialog::layerActionTriggered()
@@ -574,7 +575,6 @@ void QgsAttributeTableDialog::filterColumnChanged( QObject* filterAction )
}

replaceSearchWidget( mFilterQuery, mCurrentSearchWidgetWrapper->widget() );

}

void QgsAttributeTableDialog::filterExpressionBuilder()
@@ -265,6 +265,7 @@ void QgsDefaultSearchWidgetWrapper::initWidget( QWidget* widget )
mLineEdit = new QgsFilterLineEdit();
}
mContainer->layout()->addWidget( mLineEdit );
mContainer->setFocusProxy( mLineEdit );

if ( fldType == QVariant::String )
{

0 comments on commit 45f4a3e

Please sign in to comment.
You can’t perform that action at this time.