Skip to content

Commit

Permalink
Automatically set focus on the line edit for attribute table filters
Browse files Browse the repository at this point in the history
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 45f4a3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -574,7 +575,6 @@ void QgsAttributeTableDialog::filterColumnChanged( QObject* filterAction )
}

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

}

void QgsAttributeTableDialog::filterExpressionBuilder()
Expand Down
1 change: 1 addition & 0 deletions src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ void QgsDefaultSearchWidgetWrapper::initWidget( QWidget* widget )
mLineEdit = new QgsFilterLineEdit();
}
mContainer->layout()->addWidget( mLineEdit );
mContainer->setFocusProxy( mLineEdit );

if ( fldType == QVariant::String )
{
Expand Down

0 comments on commit 45f4a3e

Please sign in to comment.