diff --git a/resources/function_help/json/concat b/resources/function_help/json/concat index 5c705db6bd6..d4b524ca696 100644 --- a/resources/function_help/json/concat +++ b/resources/function_help/json/concat @@ -1,9 +1,10 @@ { "function": "concat", - "description": "Concatenates several strings to one.", + "description": "Concatenates several strings to one. NULL values are converted to empty strings.", "variableLenArguments": true, "arguments": [ {"arg":"string1", "syntaxOnly": true}, {"arg":"string2", "syntaxOnly": true}, {"arg":"string", "descOnly": true, "description":"a string value"}], - "examples": [ { "expression":"concat('a','b','c','d','e')", "returns":"'abcde'"}] + "examples": [ { "expression":"concat('a','b','c','d','e')", "returns":"'abcde'"}, + { "expression":"concat('The Wall', NULL)", "returns":"'The Wall'"}] } diff --git a/resources/function_help/text/AND b/resources/function_help/text/AND index ac88fe40d5b..e4aaa40a9be 100644 --- a/resources/function_help/text/AND +++ b/resources/function_help/text/AND @@ -7,7 +7,9 @@ Returns 1 when condition a and b are true.

Arguments

None -

Example

-
 4 = 2+2 AND 1 = 1  → returns 1 
-
 4 = 2+2 AND 1 = 2  → returns 0 
+

Examples

+
 TRUE AND TRUE  → 1 
+
 TRUE AND FALSE  → 0 
+
 4 = 2+2 AND 1 = 1  → 1 
+
 4 = 2+2 AND 1 = 2  → 0 
diff --git a/resources/function_help/text/|| b/resources/function_help/text/|| new file mode 100644 index 00000000000..2f13c6d05ff --- /dev/null +++ b/resources/function_help/text/|| @@ -0,0 +1,14 @@ +

|| concatenation operator

+

Joins two values together into a string.

+

If one of the values is NULL the result will be NULL. See the CONCAT function for a different behavior.

+ +

Syntax

+
 value1 || value2
+ +

Arguments

+None + +

Examples

+
 'Here ' || 'and ' || 'there' → 'Here and there' 
+
 'Nothing' || NULL → NULL 
+
 1 || 2 → '12' 
diff --git a/src/gui/qgsexpressionbuilderwidget.cpp b/src/gui/qgsexpressionbuilderwidget.cpp index dd324fadedb..1f3d5a8689c 100644 --- a/src/gui/qgsexpressionbuilderwidget.cpp +++ b/src/gui/qgsexpressionbuilderwidget.cpp @@ -362,6 +362,7 @@ void QgsExpressionBuilderWidget::registerItem( QString group, newgroupNode->setData( group, Qt::UserRole ); newgroupNode->setData( group == "Recent (Selection)" ? 2 : 1, QgsExpressionItem::CustomSortRole ); newgroupNode->appendRow( item ); + newgroupNode->setBackground( QBrush( QColor( "#eee" ) ) ); mModel->appendRow( newgroupNode ); mExpressionGroups.insert( group, newgroupNode ); } @@ -439,12 +440,7 @@ void QgsExpressionBuilderWidget::updateFunctionTree() registerItem( "Operators", "<>", " <> ", tr( "Unequal operator" ) ); registerItem( "Operators", "<=", " <= ", tr( "Less or equal operator" ) ); registerItem( "Operators", ">=", " >= ", tr( "Greater or equal operator" ) ); - registerItem( "Operators", "||", " || ", - QString( "|| %1
%2
%3:%4" ) - .arg( tr( "(String Concatenation)" ) ) - .arg( tr( "Joins two values together into a string" ) ) - .arg( tr( "Usage" ) ) - .arg( tr( "'Dia' || Diameter" ) ) ); + registerItem( "Operators", "||", " || " ); registerItem( "Operators", "IN", " IN " ); registerItem( "Operators", "LIKE", " LIKE " ); registerItem( "Operators", "ILIKE", " ILIKE " );