mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Improve expression help
This commit is contained in:
parent
6bfdafe3d3
commit
b2c404d17c
@ -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 → returns 1 </pre>
|
||||
<pre> 4 = 2+2 AND 1 = 2 → returns 0 </pre>
|
||||
<h4>Examples</h4>
|
||||
<pre> TRUE AND TRUE → 1 </pre>
|
||||
<pre> TRUE AND FALSE → 0 </pre>
|
||||
<pre> 4 = 2+2 AND 1 = 1 → 1 </pre>
|
||||
<pre> 4 = 2+2 AND 1 = 2 → 0 </pre>
|
||||
|
||||
|
14
resources/function_help/text/||
Normal file
14
resources/function_help/text/||
Normal file
@ -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' → 'Here and there' </pre>
|
||||
<pre> 'Nothing' || NULL → NULL </pre>
|
||||
<pre> 1 || 2 → '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 " );
|
||||
|
Loading…
x
Reference in New Issue
Block a user