Skip to content
Permalink
Browse files

apply #6281

  • Loading branch information
jef-n committed Oct 4, 2012
1 parent 14cad93 commit b121a2f6884288d73da57da79ad5b9a64653c609
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/gui/qgsattributeeditor.cpp
@@ -192,9 +192,6 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed

case QgsVectorLayer::ValueRelation:
{
QSettings settings;
QString nullValue = settings.value( "qgis/nullValue", "NULL" ).toString();

const QgsVectorLayer::ValueRelationData &data = vl->valueRelation( idx );

QgsVectorLayer *layer = qobject_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( data.mLayer ) );
@@ -209,9 +206,6 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
if ( !data.mFilterAttributeColumn.isNull() )
fi = layer->fieldNameIndex( data.mFilterAttributeColumn );

if ( data.mAllowNull )
map.insert( nullValue, tr( "(no selection)" ) );

if ( ki >= 0 && vi >= 0 )
{
QgsAttributeList attributes;
@@ -236,6 +230,12 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
QComboBox *cb = comboBox( editor, parent );
if ( cb )
{
if ( data.mAllowNull )
{
QSettings settings;
cb->addItem( tr( "(no selection)" ), settings.value( "qgis/nullValue", "NULL" ).toString() );
}

for ( QMap< QString, QString >::const_iterator it = map.begin(); it != map.end(); it++ )
{
if ( data.mOrderByValue )

0 comments on commit b121a2f

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