Skip to content
Permalink
Browse files

improve sorting of field values for the query builder (#6046)

  • Loading branch information
nirvn committed Jan 12, 2018
1 parent 074db04 commit f3ced09632c64beafd0b07fcc4d25d96db6555b5
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/qgsquerybuilder.cpp
@@ -137,7 +137,8 @@ void QgsQueryBuilder::fillValues( int idx, int limit )
mModelValues->clear();

// determine the field type
QSet<QVariant> values = mLayer->uniqueValues( idx, limit );
QList<QVariant> values = mLayer->uniqueValues( idx, limit ).toList();
std::sort( values.begin(), values.end() );

QString nullValue = QgsApplication::nullRepresentation();

@@ -159,7 +160,6 @@ void QgsQueryBuilder::fillValues( int idx, int limit )
mModelValues->insertRow( mModelValues->rowCount(), myItem );
QgsDebugMsg( QString( "Value is null: %1\nvalue: %2" ).arg( var.isNull() ).arg( var.isNull() ? nullValue : var.toString() ) );
}
mModelValues->sort( 0 );
}

void QgsQueryBuilder::btnSampleValues_clicked()

0 comments on commit f3ced09

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