Skip to content

Commit f3ced09

Browse files
authoredJan 12, 2018
improve sorting of field values for the query builder (#6046)
1 parent 074db04 commit f3ced09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/gui/qgsquerybuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ void QgsQueryBuilder::fillValues( int idx, int limit )
137137
mModelValues->clear();
138138

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

142143
QString nullValue = QgsApplication::nullRepresentation();
143144

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

165165
void QgsQueryBuilder::btnSampleValues_clicked()

0 commit comments

Comments
 (0)
Please sign in to comment.