Skip to content

Commit

Permalink
use proxy model
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 12, 2014
1 parent 5751cad commit 9fc5b78
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gui/qgsfieldexpressionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,8 @@ void QgsFieldExpressionWidget::setField( const QString fieldName )
// new expression
idx = mFieldProxyModel->sourceFieldModel()->setExpression( fieldName );
}

QModelIndex proxyIndex = mFieldProxyModel->mapFromSource( idx );

mCombo->setCurrentIndex( proxyIndex.row() );

currentFieldChanged();
}

Expand Down Expand Up @@ -169,7 +166,8 @@ void QgsFieldExpressionWidget::expressionEditingFinished()
{
const QString expression = mCombo->lineEdit()->text();
QModelIndex idx = mFieldProxyModel->sourceFieldModel()->setExpression( expression );
mCombo->setCurrentIndex( idx.row() );
QModelIndex proxyIndex = mFieldProxyModel->mapFromSource( idx );
mCombo->setCurrentIndex( proxyIndex.row() );
currentFieldChanged();
}

Expand Down

0 comments on commit 9fc5b78

Please sign in to comment.