Skip to content

Commit

Permalink
improve sorting of field values for the query builder (#6046)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 12, 2018
1 parent 074db04 commit f3ced09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/qgsquerybuilder.cpp
Expand Up @@ -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();

Expand All @@ -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()
Expand Down

0 comments on commit f3ced09

Please sign in to comment.