Skip to content
Permalink
Browse files

Improve expression help

  • Loading branch information
m-kuhn committed Sep 20, 2015
1 parent 6bfdafe commit b2c404d17c366b835b54acdc18721c249da86860
@@ -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'"}]
}
@@ -7,7 +7,9 @@ Returns 1 when condition a and b are true.
<h4>Arguments</h4>
None

<h4>Example</h4>
<pre> 4 = 2+2 AND 1 = 1 &rarr; returns 1 </pre>
<pre> 4 = 2+2 AND 1 = 2 &rarr; returns 0 </pre>
<h4>Examples</h4>
<pre> TRUE AND TRUE &rarr; 1 </pre>
<pre> TRUE AND FALSE &rarr; 0 </pre>
<pre> 4 = 2+2 AND 1 = 1 &rarr; 1 </pre>
<pre> 4 = 2+2 AND 1 = 2 &rarr; 0 </pre>

@@ -0,0 +1,14 @@
<h3>|| concatenation operator</h3>
<p>Joins two values together into a string.</p>
<p>If one of the values is NULL the result will be NULL. See the CONCAT function for a different behavior.</p>

<h4>Syntax</h4>
<pre> value1 || value2</pre>

<h4>Arguments</h4>
None

<h4>Examples</h4>
<pre> 'Here ' || 'and ' || 'there' &rarr; 'Here and there' </pre>
<pre> 'Nothing' || NULL &rarr; NULL </pre>
<pre> 1 || 2 &rarr; '12' </pre>
@@ -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( "<b>|| %1</b><br><i>%2</i><br><i>%3:</i>%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 " );

0 comments on commit b2c404d

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