File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ QgsFeatureRequest::OrderBy QgsOrderByDialog::orderBy()
58
58
for ( int i = 0 ; i < mOrderByTableWidget ->rowCount (); ++i )
59
59
{
60
60
QString expressionText = static_cast <QgsFieldExpressionWidget*>( mOrderByTableWidget ->cellWidget ( i, 0 ) )->currentText ();
61
+ bool isExpression = static_cast <QgsFieldExpressionWidget*>( mOrderByTableWidget ->cellWidget ( i, 0 ) )->isExpression ();
61
62
62
63
if ( ! expressionText.isEmpty () )
63
64
{
@@ -71,6 +72,9 @@ QgsFeatureRequest::OrderBy QgsOrderByDialog::orderBy()
71
72
if ( nullsFirstIndex == 1 )
72
73
nullsFirst = true ;
73
74
75
+ if ( !isExpression )
76
+ expressionText = QgsExpression::quotedColumnRef ( expressionText );
77
+
74
78
QgsFeatureRequest::OrderByClause orderByClause ( expressionText, asc, nullsFirst );
75
79
76
80
orderBy << orderByClause;
You can’t perform that action at this time.
0 commit comments