More expression help

This commit is contained in:
Matthias Kuhn 2015-09-20 14:18:25 +02:00
parent 2a6cff403b
commit 41a330f271
9 changed files with 112 additions and 7 deletions

View File

@ -0,0 +1,13 @@
<h3>* multiplication operator</h3>
<p>Multiplication of two values</p>
<p>If one of the values is NULL the result will be NULL.</p>
<h4>Syntax</h4>
<pre> value1 * value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 * 4 &rarr; 20 </pre>
<pre> 5 * NULL &rarr; NULL </pre>

View File

@ -0,0 +1,13 @@
<h3>+ addition operator</h3>
<p>Addition of two values</p>
<p>If one of the values is NULL the result will be NULL.</p>
<h4>Syntax</h4>
<pre> value1 + value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 + 4 &rarr; 9 </pre>
<pre> 5 + NULL &rarr; NULL </pre>

View File

@ -0,0 +1,13 @@
<h3>- subtract operator</h3>
<p>Subtraction of two values</p>
<p>If one of the values is NULL the result will be NULL.</p>
<h4>Syntax</h4>
<pre> value1 - value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 - 4 &rarr; 1 </pre>
<pre> 5 - NULL &rarr; NULL </pre>

View File

@ -0,0 +1,13 @@
<h3>&lt; Less than operator</h3>
<p>Compares two values and evaluates to 1 if the left value is less than the right value</p>
<h4>Syntax</h4>
<pre> value1 &lt; value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 &lt; 4 &rarr; 0 </pre>
<pre> 5 &lt; 5 &rarr; 0 </pre>
<pre> 4 &lt; 5 &rarr; 1 </pre>

View File

@ -0,0 +1,13 @@
<h3>&lt;= Less than or equal operator</h3>
<p>Compares two values and evaluates to 1 if the left value is less than or equal to the right value</p>
<h4>Syntax</h4>
<pre> value1 &lt;= value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 &lt;= 4 &rarr; 0 </pre>
<pre> 5 &lt;= 5 &rarr; 1 </pre>
<pre> 4 &lt;= 5 &rarr; 1 </pre>

View File

@ -0,0 +1,14 @@
<h3>&lt;&gt; Unequal operator</h3>
<p>Compares two values and evaluates to 1 if they are not equal.</p>
<h4>Syntax</h4>
<pre> value1 &lt;&gt; value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 &lt;&gt; 4 &rarr; 1 </pre>
<pre> 4 &lt;&gt; 4 &rarr; 0 </pre>
<pre> 5 &lt;&gt; NULL &rarr; NULL </pre>
<pre> NULL &lt;&gt; NULL &rarr; NULL </pre>

View File

@ -0,0 +1,13 @@
<h3>&gt; Greater than operator</h3>
<p>Compares two values and evaluates to 1 if the left value is greater than the right value</p>
<h4>Syntax</h4>
<pre> value1 &gt; value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 &gt; 4 &rarr; 1 </pre>
<pre> 5 &gt; 5 &rarr; 0 </pre>
<pre> 4 &gt; 5 &rarr; 0 </pre>

View File

@ -0,0 +1,13 @@
<h3>&gt;= Greater or equal operator</h3>
<p>Compares two values and evaluates to 1 if the left value is greater than or equal to the right value</p>
<h4>Syntax</h4>
<pre> value1 &gt;= value2 </pre>
<h4>Arguments</h4>
None
<h4>Examples</h4>
<pre> 5 &gt;= 4 &rarr; 1 </pre>
<pre> 5 &gt;= 5 &rarr; 1 </pre>
<pre> 4 &gt;= 5 &rarr; 0 </pre>

View File

@ -428,18 +428,18 @@ void QgsExpressionBuilderWidget::updateFunctionTree()
mModel->clear();
mExpressionGroups.clear();
// TODO Can we move this stuff to QgsExpression, like the functions?
registerItem( "Operators", "+", " + ", tr( "Addition operator" ) );
registerItem( "Operators", "-", " - ", tr( "Subtraction operator" ) );
registerItem( "Operators", "*", " * ", tr( "Multiplication operator" ) );
registerItem( "Operators", "+", " + " );
registerItem( "Operators", "-", " - " );
registerItem( "Operators", "*", " * " );
registerItem( "Operators", "/", " / ", tr( "Division operator" ) );
registerItem( "Operators", "%", " % ", tr( "Modulo operator" ) );
registerItem( "Operators", "^", " ^ ", tr( "Power operator" ) );
registerItem( "Operators", "=", " = ", tr( "Equal operator" ) );
registerItem( "Operators", ">", " > ", tr( "Greater as operator" ) );
registerItem( "Operators", "<", " < ", tr( "Less than operator" ) );
registerItem( "Operators", ">", " > " );
registerItem( "Operators", "<", " < " );
registerItem( "Operators", "<>", " <> ", tr( "Unequal operator" ) );
registerItem( "Operators", "<=", " <= ", tr( "Less or equal operator" ) );
registerItem( "Operators", ">=", " >= ", tr( "Greater or equal operator" ) );
registerItem( "Operators", "<=", " <= " );
registerItem( "Operators", ">=", " >= " );
registerItem( "Operators", "||", " || " );
registerItem( "Operators", "IN", " IN " );
registerItem( "Operators", "LIKE", " LIKE " );