Skip to content
Permalink
Browse files
use proxy model
  • Loading branch information
3nids committed May 12, 2014
1 parent 5751cad commit 9fc5b781b8a207bf918ea6ad3e09e3269a526968
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/gui/qgsfieldexpressionwidget.cpp
@@ -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();
}

@@ -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();
}

0 comments on commit 9fc5b78

Please sign in to comment.