Skip to content

Commit

Permalink
Expresson widget - Set first item on search result
Browse files Browse the repository at this point in the history
For Nyall :)
  • Loading branch information
NathanW2 committed Feb 23, 2016
1 parent 24d1bd0 commit fad0b1d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -633,9 +633,19 @@ void QgsExpressionBuilderWidget::on_txtSearchEdit_textChanged()
{
mProxyModel->setFilterWildcard( txtSearchEdit->text() );
if ( txtSearchEdit->text().isEmpty() )
{
expressionTree->collapseAll();
}
else
{
expressionTree->expandAll();
QModelIndex index = mProxyModel->index( 0, 0 );
if ( mProxyModel->hasChildren( index ) )
{
QModelIndex child = mProxyModel->index( 0, 0, index );
expressionTree->selectionModel()->setCurrentIndex( child, QItemSelectionModel::ClearAndSelect );
}
}
}

void QgsExpressionBuilderWidget::on_txtSearchEditValues_textChanged()
Expand Down

0 comments on commit fad0b1d

Please sign in to comment.