Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More expression help
  • Loading branch information
m-kuhn committed Sep 20, 2015
1 parent 2a6cff4 commit 41a330f
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 7 deletions.
13 changes: 13 additions & 0 deletions resources/function_help/text/*
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/text/+
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/text/-
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/text/<
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/text/<=
@@ -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>
14 changes: 14 additions & 0 deletions resources/function_help/text/<>
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/text/>
@@ -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>
13 changes: 13 additions & 0 deletions resources/function_help/text/>=
@@ -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>
14 changes: 7 additions & 7 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -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 " );
Expand Down

0 comments on commit 41a330f

Please sign in to comment.