2 #include <QCoreApplication>
11 gFunctionHelpTexts.insert(
"tostring", QCoreApplication::translate(
"function_help",
"<h3>tostring() function</h3>\n"
12 "Converts a number to string.\n"
14 "<p><h4>Syntax</h4>\n"
15 " tostring(<i>number</i>)</p>\n"
17 "<p><h4>Arguments</h4>\n"
18 "<!-- List args for functions here-->\n"
19 "<i>number</i> → is integer or real. The number to convert to string.</p>\n"
21 "<p><h4>Example</h4>\n"
22 "<!-- Show example of function.-->\n"
23 " tostring(123) → '123'</p>\n"
25 gFunctionHelpTexts.insert(
"distance", QCoreApplication::translate(
"function_help",
"<h3>distance function</h3>\n"
26 " Returns the minimum distance (based on spatial ref) between two geometries in projected units.\n"
29 "<pre>distance( a, b )</pre>\n"
31 "<h4>Arguments</h4>\n"
36 "<pre> distance( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(4 8)' )) → returns 4</pre>\n"
38 gFunctionHelpTexts.insert(
"disjoint", QCoreApplication::translate(
"function_help",
"<h3>disjoint function</h3>\n"
39 "Returns 1 if the geometries do not \"spatially intersect\" - if they do not share any space together. \n"
42 "<pre>disjoint( a, b )</pre>\n"
44 "<h4>Arguments</h4>\n"
49 "<pre> disjoint( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
50 "<pre> disjoint( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'POINT(4 4)' )) → returns 0</pre>\n"
52 gFunctionHelpTexts.insert(
"Conditions", QCoreApplication::translate(
"function_help",
"<h3>Conditions Group</h3>\n"
53 "This group contains functions that operate on condition.\n"
55 gFunctionHelpTexts.insert(
"asin", QCoreApplication::translate(
"function_help",
"<h3>asin() function</h3>\n"
56 "Returns arcussinus of a value in radians.\n"
59 "<p><h4>Syntax</h4>\n"
60 " asin(<i>real</i>)</p>\n"
62 "<p><h4>Arguments</h4>\n"
63 "<i>real</i> → sin of an angle.</p>\n"
65 "<p><h4>Example</h4>\n"
66 " asin(1.0) → 1.5707963267949</p>\n"
68 gFunctionHelpTexts.insert(
"String", QCoreApplication::translate(
"function_help",
"<h3>String Group</h3>\n"
69 "This group contains functions that operate on strings e.g replace, convert to upper case.\n"
71 gFunctionHelpTexts.insert(
"centroid", QCoreApplication::translate(
"function_help",
"<h3>centroid function</h3>\n"
72 "Returns the geometric center of a geometry.\n"
75 "<pre>centroid(a)</pre>\n"
77 "<h4>Arguments</h4>\n"
81 "<pre> centroid($geometry) → returns a point geometry</pre>\n"
84 gFunctionHelpTexts.insert(
"IS", QCoreApplication::translate(
"function_help",
"<h3>IS expression</h3>\n"
85 "Returns 1 if a is the same as b.\n"
90 "<h4>Arguments</h4>\n"
94 "<pre> 'A' IS 'A' → returns 1 </pre>\n"
95 "<pre> 'A' IS 'a' → returns 0 </pre>\n"
96 "<pre> 4 IS 4 → returns 1 </pre>\n"
97 "<pre> 4 IS 2+2 → returns 1 </pre>\n"
98 "<pre> 4 IS 2 → returns 0 </pre>\n"
99 "<pre> 4 IS 2 → returns 0 </pre>\n"
100 "<pre> $geometry IS NULL → returns 0, if your geometry is not NULL</pre>\n"
103 gFunctionHelpTexts.insert(
"$now", QCoreApplication::translate(
"function_help",
"<h3>$now function</h3>\n"
104 "Returns the current date and time\n"
109 "<h4>Arguments</h4>\n"
113 "<pre>$now → 2012-07-22T13:24:57</pre>\n"
116 gFunctionHelpTexts.insert(
"bbox", QCoreApplication::translate(
"function_help",
"<h3>bbox function</h3>\n"
117 "Returns 1 if the geometries spatially intersect the bounding box defined and 0 if they don't.\n"
120 "<pre>bbox( a, b )</pre>\n"
122 "<h4>Arguments</h4>\n"
123 "a → geometry\n"
124 "b → geometry\n"
127 "<pre>bbox( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
128 "<pre>bbox( geomFromWKT( 'POINT(6 5)' ) , geomFromWKT( 'POLYGON((3 3 , 4 4 , 5 5, 3 3))' )) → returns 0</pre>\n"
130 gFunctionHelpTexts.insert(
"regexp_replace", QCoreApplication::translate(
"function_help",
"<h3>regexp_replace() function</h3>\n"
131 "Returns a string with the supplied regular expression replaced.\n"
133 "<p><h4>Syntax</h4>\n"
134 " regexp_replace(<i>string,regex,after</i>)</p>\n"
136 "<p><h4>Arguments</h4>\n"
137 "<!-- List args for functions here-->\n"
138 "<i> string</i> → is string. The start string.<br>\n"
139 "<i> regex</i> → is string. The regular expression to replace. Backslash characters must be double escaped (eg \"\\s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
140 "<i> after</i> → is string. The string that will replace any matching occurences of the supplied regular expression. Captured groups can be inserted into the replacement string using \\1, \\2, etc. <br></p>\n"
142 "<p><h4>Example</h4>\n"
143 "<!-- Show example of function.-->\n"
144 " regexp_replace('QGIS SHOULD ROCK','\\sSHOULD\\s',' DOES ') → 'QGIS DOES ROCK'</p>\n"
146 gFunctionHelpTexts.insert(
"Conversions", QCoreApplication::translate(
"function_help",
"<h3>Conversions Group</h3>\n"
147 "This group contains functions to convert on data type to another e.g string to integer, integer to string.\n"
149 gFunctionHelpTexts.insert(
"randf", QCoreApplication::translate(
"function_help",
"<h3>randf() function</h3>\n"
150 "Returns a random float within the range specified by the minimum and \n"
151 "maximum argument (inclusive).\n"
153 "This function takes two arguments.\n"
155 "<code>randf(min, max)</code><br>\n"
157 "<h4>Arguments</h4>\n"
158 "<code>min</code> - a float representing the smallest possible random number desired.<br>\n"
159 "<code>max</code> - a float representing the largest possible random number desired.\n"
163 "<!-- Show example of function.-->\n"
164 "<code>randf(1, 10) → 4.59258286403147</code><br>\n"
166 gFunctionHelpTexts.insert(
"replace", QCoreApplication::translate(
"function_help",
"<h3>replace() function</h3>\n"
167 "Returns a string with the the supplied string replaced.\n"
169 "<p><h4>Syntax</h4>\n"
170 " replace(<i>string,before,after</i>)</p>\n"
172 "<p><h4>Arguments</h4>\n"
173 "<!-- List args for functions here-->\n"
174 "<i> string</i> → is string. The start string.<br>\n"
175 "<i> before</i> → is string. The string to replace.<br>\n"
176 "<i> after</i> → is string. The string that will replace <i>before</i><br></p>\n"
178 "<p><h4>Example</h4>\n"
179 "<!-- Show example of function.-->\n"
180 " replace('QGIS SHOULD ROCK','SHOULD','DOES') → 'QGIS DOES ROCK'</p>\n"
182 gFunctionHelpTexts.insert(
"Math", QCoreApplication::translate(
"function_help",
"<h3>Math Group</h3>\n"
183 "This group contains math functions e.g square root, sin and cos\n"
185 gFunctionHelpTexts.insert(
"left", QCoreApplication::translate(
"function_help",
"<h3>left() function</h3>\n"
186 "Returns a substring that contains the <i>n</i> leftmost characters of the string.\n"
189 "<code>left(string, length)</code><br>\n"
191 "<h4>Arguments</h4>\n"
192 "<code>string</code> - is string. The string.\n"
194 "<code>length</code> - is int. The number of characters from the left to return.\n"
197 "<!-- Show example of function.-->\n"
198 "<code>left('Hello World',5) → 'Hello'</code><br>\n"
201 gFunctionHelpTexts.insert(
"day", QCoreApplication::translate(
"function_help",
"<h3>day() function</h3>\n"
202 "Extract the day from a date, or the number of days\n"
203 "from a <code>Interval</code>\n"
206 "<code>day(date)</code><br>\n"
207 "<code>day(Interval)</code><br>\n"
209 "<h4>Arguments</h4>\n"
210 "<code>date</code> - is date or datetime. The date to extract the day from.\n"
212 "<code>Interval</code> - is Interval. The Interval to return the number of days from.\n"
215 "<!-- Show example of function.-->\n"
216 "<code>day('2012-05-12') → 12</code><br>\n"
217 "<code>day(tointerval('3 days')) → 3</code><br>\n"
218 "<code>day(age('2012-01-01','2010-01-01')) → 730</code><br>\n"
221 gFunctionHelpTexts.insert(
"log", QCoreApplication::translate(
"function_help",
"<h3>log() function</h3>\n"
222 "Returns the value of the logarithm of the passed value and base.\n"
224 "This function takes two arguments.\n"
226 "<code>log(base, value)</code><br>\n"
228 "<h4>Arguments</h4>\n"
229 "<code>base</code> - any positive number.<br>\n"
230 "<code>value</code> - any positive number.\n"
234 "<!-- Show example of function.-->\n"
235 "<code>log(2, 32) → 5</code><br>\n"
236 "<code>log(0.5, 32) → -5</code><br>\n"
238 gFunctionHelpTexts.insert(
"OR", QCoreApplication::translate(
"function_help",
"<h3>OR logical operator</h3>\n"
239 "Returns 1 when condition a or b is true.\n"
242 "<pre> condition a OR condition b </pre>\n"
244 "<h4>Arguments</h4>\n"
248 "<pre> 4 = 2+2 OR 1 = 1 → returns 1 </pre>\n"
249 "<pre> 4 = 2+2 OR 1 = 2 → returns 1 </pre>\n"
250 "<pre> 4 = 2 OR 1 = 2 → returns 0 </pre>\n"
252 gFunctionHelpTexts.insert(
"$rownum", QCoreApplication::translate(
"function_help",
"<h3>$rownum function</h3>\n"
253 "Returns the number of the current row.\n"
256 "<pre>$rownum</pre>\n"
258 "<h4>Arguments</h4>\n"
262 "<pre>$rownum → 4711</pre>\n"
265 gFunctionHelpTexts.insert(
"title", QCoreApplication::translate(
"function_help",
"<h3>title() function</h3>\n"
266 "Converts all words of a string to title case (all words lower case with leading\n"
269 "<p><h4>Syntax</h4>\n"
270 " title(<i>string</i>)</p>\n"
272 "<p><h4>Arguments</h4>\n"
273 "<!-- List args for functions here-->\n"
274 "<i> string</i> → is string. The string to convert to title case.</p>\n"
276 "<p><h4>Example</h4>\n"
277 "<!-- Show example of function.-->\n"
278 " upper('hello WOrld') → 'Hello World'</p>\n"
280 gFunctionHelpTexts.insert(
"color_rgba", QCoreApplication::translate(
"function_help",
"\n"
281 "<h3>color_rgba() function</h3>\n"
282 "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components\n"
284 "<p><h4>Syntax</h4>\n"
285 " color_rgba(<i>red, green, blue, alpha</i>)</p>\n"
287 "<p><h4>Arguments</h4>\n"
288 "<!-- List args for functions here-->\n"
289 "<i> red</i> → the red component as an integer value from 0 to 255.<br>\n"
290 "<i> green</i> → the green component as an integer value from 0 to 255.<br>\n"
291 "<i> blue</i> → the blue component as an integer value from 0 to 255.<br>\n"
292 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
294 "<p><h4>Example</h4>\n"
295 "<!-- Show example of function.-->\n"
296 " color_rgba(255,127,0,200) → '255,127,0,200'</p>\n"
298 gFunctionHelpTexts.insert(
"color_hsva", QCoreApplication::translate(
"function_help",
"<h3>color_hsva() function</h3>\n"
299 "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes\n"
301 "<p><h4>Syntax</h4>\n"
302 " color_hsva(<i>hue, saturation, value, alpha</i>)</p>\n"
304 "<p><h4>Arguments</h4>\n"
305 "<!-- List args for functions here-->\n"
306 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
307 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
308 "<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br>\n"
309 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
311 "<p><h4>Example</h4>\n"
312 "<!-- Show example of function.-->\n"
313 " color_hsva(40,100,100,200) → '255,170,0,200'</p>\n"
315 gFunctionHelpTexts.insert(
"Date and Time", QCoreApplication::translate(
"function_help",
"<h3>Date and Time Group</h3>\n"
316 "This group contains functions for handling date and time data.\n"
318 gFunctionHelpTexts.insert(
"regexp_substr", QCoreApplication::translate(
"function_help",
"<h3>regexp_substr() function</h3>\n"
319 "Returns the portion of a string which matches a supplied regular expression.\n"
321 "<p><h4>Syntax</h4>\n"
322 " regexp_substr(<i>string,regex</i>)</p>\n"
324 "<p><h4>Arguments</h4>\n"
325 "<!-- List args for functions here-->\n"
326 "<i> string</i> → is string. The input string.<br>\n"
327 "<i> regex</i> → is string. The regular expression to match against. Backslash characters must be double escaped (eg \"\\s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
329 "<p><h4>Example</h4>\n"
330 "<!-- Show example of function.-->\n"
331 " regexp_substr('abc123','(\\d+)') → '123'</p>\n"
333 gFunctionHelpTexts.insert(
"log10", QCoreApplication::translate(
"function_help",
"<h3>log10() function</h3>\n"
334 "Returns the value of the base 10 logarithm of the passed expression.\n"
336 "This function takes one argument.\n"
338 "<code>log10(value)</code><br>\n"
340 "<h4>Arguments</h4>\n"
341 "<code>value</code> - any positive number.\n"
345 "<!-- Show example of function.-->\n"
346 "<code>log10(1) → 0</code><br>\n"
347 "<code>log10(100) → 2</code><br>\n"
349 gFunctionHelpTexts.insert(
"format_date", QCoreApplication::translate(
"function_help",
"<h3>format_date() function</h3>\n"
350 "Format a date type or string into a custom string format. Uses Qt data time format strings. See <a href='http://qt-project.org/doc/qt-4.8/qdatetime.html#toString'>QDateTime::toString</a>\n"
353 "<code>format_date('string', 'format_string')</code><br>\n"
355 "<h4>Arguments</h4>\n"
356 "<code>string</code> - is string. Date/Time/DateTime string.\n"
358 "<code>format_string</code> - is string. String template used to format the string.\n"
363 " <th>Expression</th>\n"
369 " <tr valign=\"top\">\n"
372 " <td>the day as number without a leading zero (1 to 31)</td>\n"
375 " <tr valign=\"top\">\n"
378 " <td>the day as number with a leading zero (01 to 31)</td>\n"
381 " <tr valign=\"top\">\n"
384 " <td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses <a href=\n"
385 " \"qdate.html#shortDayName\">QDate::shortDayName</a>().</td>\n"
388 " <tr valign=\"top\">\n"
391 " <td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses <a href=\n"
392 " \"qdate.html#longDayName\">QDate::longDayName</a>().</td>\n"
395 " <tr valign=\"top\">\n"
398 " <td>the month as number without a leading zero (1-12)</td>\n"
401 " <tr valign=\"top\">\n"
404 " <td>the month as number with a leading zero (01-12)</td>\n"
407 " <tr valign=\"top\">\n"
410 " <td>the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses <a href=\n"
411 " \"qdate.html#shortMonthName\">QDate::shortMonthName</a>().</td>\n"
414 " <tr valign=\"top\">\n"
417 " <td>the long localized month name (e.g. 'January' to 'December'). Uses <a href=\n"
418 " \"qdate.html#longMonthName\">QDate::longMonthName</a>().</td>\n"
421 " <tr valign=\"top\">\n"
424 " <td>the year as two digit number (00-99)</td>\n"
427 " <tr valign=\"top\">\n"
430 " <td>the year as four digit number</td>\n"
434 " <p>These expressions may be used for the time part of the format string:</p>\n"
439 " <th>Expression</th>\n"
445 " <tr valign=\"top\">\n"
448 " <td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td>\n"
451 " <tr valign=\"top\">\n"
454 " <td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td>\n"
457 " <tr valign=\"top\">\n"
460 " <td>the hour without a leading zero (0 to 23, even with AM/PM display)</td>\n"
463 " <tr valign=\"top\">\n"
466 " <td>the hour with a leading zero (00 to 23, even with AM/PM display)</td>\n"
469 " <tr valign=\"top\">\n"
472 " <td>the minute without a leading zero (0 to 59)</td>\n"
475 " <tr valign=\"top\">\n"
478 " <td>the minute with a leading zero (00 to 59)</td>\n"
481 " <tr valign=\"top\">\n"
484 " <td>the second without a leading zero (0 to 59)</td>\n"
487 " <tr valign=\"top\">\n"
490 " <td>the second with a leading zero (00 to 59)</td>\n"
493 " <tr valign=\"top\">\n"
496 " <td>the milliseconds without leading zeroes (0 to 999)</td>\n"
499 " <tr valign=\"top\">\n"
502 " <td>the milliseconds with leading zeroes (000 to 999)</td>\n"
505 " <tr valign=\"top\">\n"
506 " <td>AP or A</td>\n"
508 " <td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td>\n"
511 " <tr valign=\"top\">\n"
512 " <td>ap or a</td>\n"
514 " <td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td>\n"
521 "<!-- Show example of function.-->\n"
522 "<code>format_date('2012-05-15','dd.mm.yyyy') → 15.05.2012</code><br>\n"
524 gFunctionHelpTexts.insert(
"combine", QCoreApplication::translate(
"function_help",
"<h3>combine function</h3>\n"
525 "Returns the combination of geometry a and geometry b.\n"
528 "<pre>combine( geometry a , geometry b)</pre>\n"
530 "<h4>Arguments</h4>\n"
531 "geometry → geometry\n"
532 "geometry → geometry\n"
535 "<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5 )' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4, 2 1 )' )) ) → returns MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5)) </pre>\n"
536 "<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 )' ) , geomFromWKT( 'LINESTRING(3 3 , 6 6, 2 1 )' )) ) → returns LINESTRING(3 3, 4 4, 6 6, 2 1) </pre>\n"
538 gFunctionHelpTexts.insert(
"atan2", QCoreApplication::translate(
"function_help",
"<h3>atan2() function</h3>\n"
539 "Returns arcustangens of y/x using the signs of the two \n"
540 "arguments to determine the quadrant of the result\n"
544 "<p><h4>Syntax</h4>\n"
545 " atan2(<i>real</i>, <i>real</i>)</p>\n"
547 "<p><h4>Arguments</h4>\n"
548 "<i>real</i> → y coordinate difference<br>\n"
549 "<i>real</i> → x coordinate difference</p>\n"
551 "<p><h4>Example</h4>\n"
552 " atan2(1.0, 1.732) → 0.523611477769969</p>\n"
554 gFunctionHelpTexts.insert(
"week", QCoreApplication::translate(
"function_help",
"<h3>week() function</h3>\n"
555 "Extract the week number from a date, or the number of weeks\n"
556 "from a <code>Interval</code>\n"
559 "<code>week(date)</code><br>\n"
560 "<code>week(Interval)</code><br>\n"
562 "<h4>Arguments</h4>\n"
563 "<code>date</code> - is date or datetime. The date to extract the week from.\n"
565 "<code>Interval</code> - is Interval. The Interval to return the number of weeks from.\n"
568 "<!-- Show example of function.-->\n"
569 "<code>week('2012-05-12') → 19</code><br>\n"
570 "<code>week(tointerval('3 weeks')) → 3</code><br>\n"
571 "<code>week(age('2012-01-01','2010-01-01')) → 104.285...</code><br>\n"
574 gFunctionHelpTexts.insert(
"Conditionals", QCoreApplication::translate(
"function_help",
"<h3>Conditionals Group</h3>\n"
575 "This group contains functions to handle conditional checks in expressions.\n"
577 gFunctionHelpTexts.insert(
"tointerval", QCoreApplication::translate(
"function_help",
"<h3>tointerval() function</h3>\n"
578 "Converts a string to a interval type. Can be used to take days, hours, month, etc off a date. \n"
581 "<code>tointerval('string')</code><br>\n"
583 "<h4>Arguments</h4>\n"
584 "<code>string</code> - is string. Format {n} days {n} hours {n} months\n"
588 "<!-- Show example of function.-->\n"
589 "<code>todatetime('2012-05-05 12:00:00') - tointerval('1 day 2 hours') → 2012-05-04T10:00:00</code><br>") );
590 gFunctionHelpTexts.insert(
"right", QCoreApplication::translate(
"function_help",
"<h3>right() function</h3>\n"
591 "Returns a substring that contains the <i>n</i> rightmost characters of the string.\n"
594 "<code>right(string, pos)</code><br>\n"
596 "<h4>Arguments</h4>\n"
597 "<code>string</code> - is string. The string.\n"
599 "<code>length</code> - is int. The number of characters from the right to return.\n"
602 "<!-- Show example of function.-->\n"
603 "<code>right('Hello World',5) → 'World'</code><br>\n"
606 gFunctionHelpTexts.insert(
"convexHull", QCoreApplication::translate(
"function_help",
"<h3>convexHull function</h3>\n"
607 "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.\n"
610 "<pre>convexHull( a, b )</pre>\n"
612 "<h4>Arguments</h4>\n"
613 "a → geometry\n"
614 "a → geometry\n"
617 "<pre> geomToWKT( convexHull( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 4 10)' )) ) → returns POLYGON((3 3,4 10,4 4,3 3)) </pre>\n"
619 gFunctionHelpTexts.insert(
"scale_exp", QCoreApplication::translate(
"function_help",
"<h3>scale_exp() function</h3>\n"
620 "Transforms a given value from an input domain to an output range using an exponential curve. This function can be used to ease values in or out \n"
621 "of the specified output range. \n"
623 "<p><h4>Syntax</h4>\n"
624 " scale_exp(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>,<i>exponent</i>)</p>\n"
626 "<p><h4>Arguments</h4>\n"
627 "<!-- List args for functions here-->\n"
628 "<i> val</i> → is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
629 "<i> domain_min, domain_max</i> → specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
630 "<i> range_min, range_max</i> → specify the output range, the smallest and largest values which should be output by the function.<br>\n"
631 "<i> exponent</i> → a positive value (greater than 0), which dictates the way input values are mapped to the output range. Large exponents will cause the output values to 'ease in', starting slowly before\n"
632 "accelerating as the input values approach the domain maximum. Smaller exponents (less than 1) will cause output values to 'ease out', where the mapping starts quickly but slows as it approaches the domain maximum.<br>\n"
635 "<!-- Show example of function.-->\n"
636 "<b>Easing in, using an exponent of 2:</b><br>\n"
637 " scale_exp(5,0,10,0,100,2) → 25<br>\n"
638 " scale_exp(7.5,0,10,0,100,2) → 56.25<br>\n"
639 " scale_exp(9.5,0,10,0,100,2) → 90.25<br> \n"
641 "<b>Easing out, using an exponent of 0.5:</b><br> \n"
642 " scale_exp(3,0,10,0,100,0.5) → 54.772<br>\n"
643 " scale_exp(6,0,10,0,100,0.5) → 77.459<br>\n"
644 " scale_exp(9,0,10,0,100,0.5) → 94.868<br> \n"
648 gFunctionHelpTexts.insert(
"acos", QCoreApplication::translate(
"function_help",
"<h3>acos() function</h3>\n"
649 "Returns arcuscosinus of a value in radians.\n"
652 "<p><h4>Syntax</h4>\n"
653 " acos(<i>real</i>)</p>\n"
655 "<p><h4>Arguments</h4>\n"
656 "<i>real</i> → cos of an angle.</p>\n"
658 "<p><h4>Example</h4>\n"
659 " acos(0.5) → 1.0471975511966</p>\n"
661 gFunctionHelpTexts.insert(
"$map", QCoreApplication::translate(
"function_help",
"<h3>$map function</h3>\n"
662 "Returns the id of the current map item if the map is being drawn in a composition, or \"canvas\" if the map is being\n"
663 "drawn within the main QGIS window.\n"
668 "<h4>Arguments</h4>\n"
672 "<!-- Show example of function.-->\n"
673 "<pre>$map → \"overview_map\" (within a composer item)<br />\n"
674 "$map → \"canvas\" (within the main QGIS main canvas)</pre>\n"
678 gFunctionHelpTexts.insert(
"intersects", QCoreApplication::translate(
"function_help",
"<h3>intersects function</h3>\n"
679 "Returns 1 if the geometries spatially intersect (share any portion of space) and 0 if they don't.\n"
682 "<pre>intersects( a, b )</pre>\n"
684 "<h4>Arguments</h4>\n"
685 "a → geometry\n"
686 "b → geometry\n"
689 "<pre> intersects( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
690 "<pre> intersects( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'POINT(5 5)' )) → returns 0</pre>\n"
692 gFunctionHelpTexts.insert(
"toint", QCoreApplication::translate(
"function_help",
"<h3>toint() function</h3>\n"
693 "Converts a string to integer number. Nothing changed if a value cannot be converted to integer (e.g '123asd' is invalid).\n"
695 "<p><h4>Syntax</h4>\n"
696 " toint(<i>string</i>)</p>\n"
698 "<p><h4>Arguments</h4>\n"
699 "<!-- List args for functions here-->\n"
700 "<i> string</i> → is string. The String to convert to integer number.</p>\n"
702 "<p><h4>Example</h4>\n"
703 "<!-- Show example of function.-->\n"
704 " toint('123') → 123</p>\n"
706 gFunctionHelpTexts.insert(
"rand", QCoreApplication::translate(
"function_help",
"<h3>rand() function</h3>\n"
707 "Returns a random integer within the range specified by the minimum and \n"
708 "maximum argument (inclusive).\n"
710 "This function takes two arguments.\n"
712 "<code>rand(min, max)</code><br>\n"
714 "<h4>Arguments</h4>\n"
715 "<code>min</code> - an integer representing the smallest possible random number desired.<br>\n"
716 "<code>max</code> - an integer representing the largest possible random number desired.\n"
720 "<!-- Show example of function.-->\n"
721 "<code>rand(1, 10) → 8</code><br>\n"
723 gFunctionHelpTexts.insert(
"floor", QCoreApplication::translate(
"function_help",
"<h3>floor() function</h3>\n"
724 "Rounds a number downwards.\n"
727 "<code>floor(value)</code><br>\n"
729 "<h4>Arguments</h4>\n"
730 "<code>value</code> - a number.\n"
734 "<!-- Show example of function.-->\n"
735 "<code>floor(4.9) → 4</code><br>\n"
736 "<code>floor(-4.9) → -5</code><br>\n"
738 gFunctionHelpTexts.insert(
"color_hsl", QCoreApplication::translate(
"function_help",
"<h3>color_hsl() function</h3>\n"
739 "Returns a string representation of a color based on its hue, saturation, and lightness attributes\n"
741 "<p><h4>Syntax</h4>\n"
742 " color_hsl(<i>hue, saturation, lightness</i>)</p>\n"
744 "<p><h4>Arguments</h4>\n"
745 "<!-- List args for functions here-->\n"
746 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
747 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
748 "<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
750 "<p><h4>Example</h4>\n"
751 "<!-- Show example of function.-->\n"
752 " color_hsl(100,50,70) → '#a6d98c'</p>\n"
754 gFunctionHelpTexts.insert(
"geomFromWKT", QCoreApplication::translate(
"function_help",
"<h3>geomFromWKT function</h3>\n"
755 "Returns a geometry created from a Well-Known Text (WKT) representation.\n"
758 "<pre>geomFromWKT(text)</pre>\n"
760 "<h4>Arguments</h4>\n"
761 "text → Well-Known Text (WKT) representation of a geometry\n"
764 "<pre> geomFromWKT( 'POINT(4 5)' ) → returns a geometry</pre>\n"
767 gFunctionHelpTexts.insert(
"max", QCoreApplication::translate(
"function_help",
"<h3>max() function</h3>\n"
768 "Returns the largest value in a set of values.\n"
771 " max(<i>value<i>[,<i>value</i>...])\n"
773 "<h4>Arguments</h4>\n"
774 "<!-- List args for functions here-->\n"
775 "<i> value</i> → a number.<br>\n"
778 "<!-- Show example of function.-->\n"
779 " max(2,10.2,5.5) → 10.2\n"
781 gFunctionHelpTexts.insert(
"coalesce", QCoreApplication::translate(
"function_help",
"<h3>coalesce() function</h3>\n"
782 "Returns the first non-NULL value from the expression list.\n"
784 "This function can take any number of arguments.\n"
786 "<code>coalesce(expression1, expression2 ...)</code><br>\n"
788 "<h4>Arguments</h4>\n"
789 "<code>expression</code> - any valid expression or value, irregardless of type.\n"
793 "<!-- Show example of function.-->\n"
794 "<code>coalesce(NULL, 2) → 2</code><br>\n"
795 "<code>coalesce(NULL, 2, 3) → 2</code><br>\n"
796 "<code>coalesce(7, NULL, 3*2) → 7</code><br><br>\n"
797 "<code>coalesce(\"fieldA\", \"fallbackField\", 'ERROR') → value of fieldA if it is non-NULL\n"
798 " else the value of \"fallbackField\" or the string 'ERROR' if both are NULL</code><br>\n"
801 gFunctionHelpTexts.insert(
"$length", QCoreApplication::translate(
"function_help",
"<h3>$length function</h3>\n"
802 "Returns the length of the current feature.\n"
805 "<pre>$length</pre>\n"
807 "<h4>Arguments</h4>\n"
811 "<pre>$length → 42.4711</pre>\n"
813 gFunctionHelpTexts.insert(
"sin", QCoreApplication::translate(
"function_help",
"<h3>sin() function</h3>\n"
814 "Returns sinus of an angle.\n"
817 "<p><h4>Syntax</h4>\n"
818 " sin(<i>real</i>)</p>\n"
820 "<p><h4>Arguments</h4>\n"
821 "<i>real</i> → angle in radians.</p>\n"
823 "<p><h4>Example</h4>\n"
824 " sin(1.571) → 0.999999682931835</p>\n"
826 gFunctionHelpTexts.insert(
"year", QCoreApplication::translate(
"function_help",
"<h3>year() function</h3>\n"
827 "Extract the year part from a date, or the number of years\n"
828 "from a <code>Interval</code>\n"
831 "<code>year(date)</code><br>\n"
832 "<code>year(Interval)</code><br>\n"
834 "<h4>Arguments</h4>\n"
835 "<code>date</code> - is date or datetime. The date to extract the year from.\n"
837 "<code>Interval</code> - is Interval. The Interval to return the number of years from.\n"
840 "<!-- Show example of function.-->\n"
841 "<code>year('2012-05-12') → 2012</code><br>\n"
842 "<code>year(tointerval('3 Years')) → 3</code><br>\n"
843 "<code>year(age('2012-01-01','2010-01-01')) → 1.9986..</code><br>\n"
846 gFunctionHelpTexts.insert(
"totime", QCoreApplication::translate(
"function_help",
"<h3>totime() function</h3>\n"
847 "Convert a string into Qt time type.\n"
850 "<code>totime('string')</code><br>\n"
852 "<h4>Arguments</h4>\n"
853 "<code>string</code> - is string in Qt time format.\n"
857 "<!-- Show example of function.-->\n"
858 "<code>totime('12:30:01') → 12:30:01</code><br>") );
859 gFunctionHelpTexts.insert(
"buffer", QCoreApplication::translate(
"function_help",
"<h3>buffer function</h3>\n"
860 "Returns a geometry that represents all points whose distance from this geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry. \n"
863 "<pre>buffer(a, b)</pre>\n"
865 "<h4>Arguments</h4>\n"
866 "a → geometry\n"
867 "b → distance for the buffer\n"
870 "<pre> buffer($geometry, 10.5 ) → returns a polygon</pre>\n"
873 gFunctionHelpTexts.insert(
"lower", QCoreApplication::translate(
"function_help",
"<h3>lower() function</h3>\n"
874 "Converts a string to lower case letters.\n"
876 "<p><h4> Syntax</h4>\n"
877 " lower(<i>string</i>)</p>\n"
879 "<p><h4> Arguments</h4>\n"
880 "<i> string</i> → is string. The String to convert to lower case.</p>\n"
882 "<p><h4> Example</h4>\n"
883 " lower('HELLO World') → 'hello world'</p>\n"
885 gFunctionHelpTexts.insert(
"substr", QCoreApplication::translate(
"function_help",
"<h3>substr() function</h3>\n"
886 "Return a part of a string\n"
888 "<p><h4>Syntax</h4>\n"
889 " substr(<i>string,startpos,length</i>)</p>\n"
891 "<p><h4>Arguments</h4>\n"
892 "<!-- List args for functions here-->\n"
893 "<i> string</i> → is string. The full string.<br>\n"
894 "<i> startpos</i> → is number. The start position to extract from.<br>\n"
895 "<i> length</i> → is number. The length of the string to extract.<br></p>\n"
897 "<p><h4>Example</h4>\n"
898 "<!-- Show example of function.-->\n"
899 " substr('HELLO WORLD',3,5) → 'LLO W'</p>\n"
901 gFunctionHelpTexts.insert(
"symDifference", QCoreApplication::translate(
"function_help",
"<h3>symDifference function</h3>\n"
902 "Returns a geometry that represents the portions of a and b that do not intersect.\n"
905 "<pre>symDifference( geometry a, geometry b)</pre>\n"
907 "<h4>Arguments</h4>\n"
908 "geometry → geometry\n"
909 "geometry → geometry\n"
912 "<pre> geomToWKT( symDifference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 8 8)' )) ) → returns LINESTRING(5 5, 8 8)</pre>\n"
914 gFunctionHelpTexts.insert(
"ln", QCoreApplication::translate(
"function_help",
"<h3>ln() function</h3>\n"
915 "Returns the value of the natural logarithm of the passed expression.\n"
917 "This function takes one argument.\n"
919 "<code>ln(value)</code><br>\n"
921 "<h4>Arguments</h4>\n"
922 "<code>value</code> - any positive number.\n"
926 "<!-- Show example of function.-->\n"
927 "<code>ln(1) → 0</code><br>\n"
928 "<code>ln(2.7182818284590452354) → 1</code><br>\n"
930 gFunctionHelpTexts.insert(
"todatetime", QCoreApplication::translate(
"function_help",
"<h3>todatetime() function</h3>\n"
931 "Convert a string into Qt data time type.\n"
934 "<code>todatetime('string')</code><br>\n"
936 "<h4>Arguments</h4>\n"
937 "<code>string</code> - is string in Qt date time format.\n"
941 "<!-- Show example of function.-->\n"
942 "<code>todatetime('2012-05-04 12:50:00') → 2012-05-04T12:50:00</code><br>") );
943 gFunctionHelpTexts.insert(
"$scale", QCoreApplication::translate(
"function_help",
"<h3>$scale function</h3>\n"
944 "Returns the current scale of the map canvas.\n"
946 "Note: This function is only available in some contexts and will be 0 otherwise. \n"
948 "<code>$scale</code><br>\n"
951 "<!-- Show example of function.-->\n"
952 "<code>$scale → 10000</code><br>\n"
956 gFunctionHelpTexts.insert(
"tan", QCoreApplication::translate(
"function_help",
"<h3>tan() function</h3>\n"
957 "Returns tangent of an angle.\n"
960 "<p><h4>Syntax</h4>\n"
961 " tan(<i>real</i>)</p>\n"
963 "<p><h4>Arguments</h4>\n"
964 "<i>real</i> → angle in radians.</p>\n"
966 "<p><h4>Example</h4>\n"
967 " tan(1.0) → 1.5574077246549</p>\n"
969 gFunctionHelpTexts.insert(
"Record", QCoreApplication::translate(
"function_help",
"<h3>Record Group</h3>\n"
970 "This group contains functions that operate on record identifiers.\n"
972 gFunctionHelpTexts.insert(
"$geometry", QCoreApplication::translate(
"function_help",
"<h3>$geometry function</h3>\n"
973 "Returns the geometry of the current feature. Can be used for processing with other functions.\n"
976 "<pre>$geometry</pre>\n"
978 "<h4>Arguments</h4>\n"
982 "<pre> geomToWKT( $geometry ) → POINT(6 50)</pre>\n"
985 gFunctionHelpTexts.insert(
"difference", QCoreApplication::translate(
"function_help",
"<h3>difference function</h3>\n"
986 "Returns a geometry that represents that part of geometry a that does not intersect with geometry b.\n"
989 "<pre>difference( a, b )</pre>\n"
991 "<h4>Arguments</h4>\n"
992 "geometry → geometry\n"
993 "geometry → geometry\n"
996 "<pre> geomToWKT( difference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4)' )) ) → returns LINESTRING(4 4, 5 5)</pre>\n"
998 gFunctionHelpTexts.insert(
"minute", QCoreApplication::translate(
"function_help",
"<h3>minute() function</h3>\n"
999 "Extract the minute from a datetime or time, or the number of minutes\n"
1000 "from a <code>Interval</code>\n"
1003 "<code>minute(datetime)</code><br>\n"
1004 "<code>minute(Interval)</code><br>\n"
1006 "<h4>Arguments</h4>\n"
1007 "<code>date</code> - is datetime or time. The date to extract the minute from.\n"
1009 "<code>Interval</code> - is Interval. The Interval to return the number of minutes from.\n"
1011 "<h4>Example</h4>\n"
1012 "<!-- Show example of function.-->\n"
1013 "<code>minute('2012-07-22T13:24:57') → 24</code><br>\n"
1014 "<code>minute(tointerval('3 minutes')) → 3</code><br>\n"
1015 "<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) → 20</code><br>\n"
1016 "<code>minute(age('2012-01-01','2010-01-01')) → 1051200</code><br>\n"
1019 gFunctionHelpTexts.insert(
"$numpages", QCoreApplication::translate(
"function_help",
"<h3>$numpages function</h3>\n"
1020 "Returns the total number of pages in the composition.\n"
1023 "<pre>$numpages</pre>\n"
1025 "<h4>Arguments</h4>\n"
1028 "<h4>Example</h4>\n"
1029 "<pre>$numpages → 42</pre>\n"
1032 gFunctionHelpTexts.insert(
"round", QCoreApplication::translate(
"function_help",
"<h3>round() function</h3>\n"
1033 "Rounds a number to number of decimal places.\n"
1035 "This function can take one or two arguments depending on what is needed.\n"
1037 "<code>round(decimal,places)</code><br>\n"
1038 "<code>round(decimal)</code><br>\n"
1040 "<h4>Arguments</h4>\n"
1041 "<code>decimal</code> - is decimal. The decimal number to be rounded.\n"
1043 "<code>places</code> - is int. The number of places to round decimal too. Can be negative.\n"
1045 "<h4>Example</h4>\n"
1046 "<!-- Show example of function.-->\n"
1047 "<code>round(1234.567, 2 ) → 1234.57</code><br>\n"
1048 "use <code>round(decimal)</code> to round to the nearest integer<br>\n"
1049 "<code>round(1234.567) → 1235</code><br>\n"
1053 gFunctionHelpTexts.insert(
"Geometry", QCoreApplication::translate(
"function_help",
"<h3>Geometry Group</h3>\n"
1054 "This group contains functions that operate on geometry objects e.g length, area.\n"
1056 gFunctionHelpTexts.insert(
"color_rgb", QCoreApplication::translate(
"function_help",
"\n"
1057 "<h3>color_rgb() function</h3>\n"
1058 "Returns a string representation of a color based on its red, green, and blue components\n"
1060 "<p><h4>Syntax</h4>\n"
1061 " color_rgb(<i>red, green, blue</i>)</p>\n"
1063 "<p><h4>Arguments</h4>\n"
1064 "<!-- List args for functions here-->\n"
1065 "<i> red</i> → the red component as an integer value from 0 to 255.<br>\n"
1066 "<i> green</i> → the green component as an integer value from 0 to 255.<br>\n"
1067 "<i> blue</i> → the blue component as an integer value from 0 to 255.<br>\n"
1069 "<p><h4>Example</h4>\n"
1070 "<!-- Show example of function.-->\n"
1071 " color_rgb(255,127,0) → '#ff7f00'</p>\n"
1073 gFunctionHelpTexts.insert(
"color_cmyk", QCoreApplication::translate(
"function_help",
"\n"
1074 "<h3>color_cmyk() function</h3>\n"
1075 "Returns a string representation of a color based on its cyan, magenta, yellow and black components\n"
1077 "<p><h4>Syntax</h4>\n"
1078 " color_cmyk(<i>cyan, magenta, yellow, black</i>)</p>\n"
1080 "<p><h4>Arguments</h4>\n"
1081 "<!-- List args for functions here-->\n"
1082 "<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
1083 "<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
1084 "<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
1085 "<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
1087 "<p><h4>Example</h4>\n"
1088 "<!-- Show example of function.-->\n"
1089 " color_cmyk(100,50,0,10) → '#0073e6'</p>\n"
1091 gFunctionHelpTexts.insert(
"$x", QCoreApplication::translate(
"function_help",
"<h3>$x function</h3>\n"
1092 "Returns the x coordinate of the current feature.\n"
1097 "<h4>Arguments</h4>\n"
1100 "<h4>Example</h4>\n"
1101 "<pre>$x → 42</pre>\n"
1104 gFunctionHelpTexts.insert(
"color_cmyka", QCoreApplication::translate(
"function_help",
"\n"
1105 "<h3>color_cmyka() function</h3>\n"
1106 "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components\n"
1108 "<p><h4>Syntax</h4>\n"
1109 " color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p>\n"
1111 "<p><h4>Arguments</h4>\n"
1112 "<!-- List args for functions here-->\n"
1113 "<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
1114 "<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
1115 "<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
1116 "<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
1117 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1119 "<p><h4>Example</h4>\n"
1120 "<!-- Show example of function.-->\n"
1121 " color_cmyka(100,50,0,10,200) → '0,115,230,200'</p>\n"
1123 gFunctionHelpTexts.insert(
"sqrt", QCoreApplication::translate(
"function_help",
"<h3>sqrt() function</h3>\n"
1124 "Returns square root of a value\n"
1127 "<p><h4>Syntax</h4>\n"
1128 " sqrt(<i>real</i>)</p>\n"
1130 "<p><h4>Arguments</h4>\n"
1131 "<i>real</i> → number.</p>\n"
1133 "<p><h4>Example</h4>\n"
1134 " sqrt(9) → 3</p>\n"
1136 gFunctionHelpTexts.insert(
"length", QCoreApplication::translate(
"function_help",
"<h3>length() function</h3>\n"
1137 "Returns the length of a string.\n"
1139 "<p><h4>Syntax</h4>\n"
1140 " length(<i>string</i>)</p>\n"
1142 "<p><h4>Arguments</h4>\n"
1143 "<!-- List args for functions here-->\n"
1144 "<i> string</i> → is string. The String to count the length of.</p>\n"
1146 "<p><h4>Example</h4>\n"
1147 "<!-- Show example of function.-->\n"
1148 " length('HELLO') → 5</p>\n"
1150 gFunctionHelpTexts.insert(
"NOT", QCoreApplication::translate(
"function_help",
"<h3>NOT</h3>\n"
1151 "Returns 1 if a is not the same as b.\n"
1154 "<pre> a NOT b </pre>\n"
1156 "<h4>Arguments</h4>\n"
1159 "<h4>Example</h4>\n"
1160 "<pre> 'a' IS NOT 'b' → returns 1 </pre>\n"
1161 "<pre> 'a' IS NOT 'a' → returns 0 </pre>\n"
1162 "<pre> 4 IS NOT 2+2 → returns 0 </pre>\n"
1165 gFunctionHelpTexts.insert(
"rpad", QCoreApplication::translate(
"function_help",
"<h3>rpad() function</h3>\n"
1166 "Returns a string with supplied width padded\n"
1167 "using the fill character.\n"
1170 "<code>rpad(string, width, fill)</code><br>\n"
1172 "<h4>Arguments</h4>\n"
1173 "<code>string</code> - is string. The string.\n"
1175 "<code>width</code> - is int. The length of the new string.\n"
1177 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1179 "<h4>Example</h4>\n"
1180 "<!-- Show example of function.-->\n"
1181 "<code>rpad('Hello', 10, 'x') → 'xxxxxHello'</code><br>\n"
1184 gFunctionHelpTexts.insert(
"lpad", QCoreApplication::translate(
"function_help",
"<h3>lpad() function</h3>\n"
1185 "Returns a string with supplied width padded\n"
1186 "using the fill character.\n"
1189 "<code>lpad(string, length, fill)</code><br>\n"
1191 "<h4>Arguments</h4>\n"
1192 "<code>string</code> - is string. The string.\n"
1194 "<code>length</code> - is int. The length of the new string.\n"
1196 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1198 "<h4>Example</h4>\n"
1199 "<!-- Show example of function.-->\n"
1200 "<code>lpad('Hello', 10, 'x') → 'Helloxxxxx'</code><br>\n"
1202 gFunctionHelpTexts.insert(
"$feature", QCoreApplication::translate(
"function_help",
"<h3>$feature function</h3>\n"
1203 "In atlas generation, returns the current feature number that is iterated over on the coverage layer.\n"
1206 "<pre>$feature</pre>\n"
1208 "<h4>Arguments</h4>\n"
1211 "<h4>Example</h4>\n"
1212 "<pre>$feature → 2</pre>\n"
1215 gFunctionHelpTexts.insert(
"strpos", QCoreApplication::translate(
"function_help",
"<h3>strpos() function</h3>\n"
1216 "Return the index of a regular expression in a string.\n"
1219 " strpos(<i>haystack</i>, <i>needle</i>)\n"
1221 "Returns -1 if the expression isn't found.\n"
1223 "<p><h4>Arguments</h4>\n"
1224 "<!-- List args for functions here-->\n"
1225 "<i> haystack</i> → is string. The string that is to be searched.<br>\n"
1226 "<i> needle</i> → is string. The regular expression to look for.<br>\n"
1228 "<h4>Example</h4>\n"
1229 "<!-- Show example of function.-->\n"
1230 " strpos('HELLO WORLD','WORLD') → 6<br>\n"
1231 " strpos('HELLO WORLD','GOODBYE') → -1<br>\n"
1233 gFunctionHelpTexts.insert(
"within", QCoreApplication::translate(
"function_help",
"<h3>within function</h3>\n"
1234 "Returns 1 if the geometry a is completely inside geometry b\n"
1237 "<pre>within( geometry a , geometry b)</pre>\n"
1239 "<h4>Arguments</h4>\n"
1240 "geometry → geometry\n"
1241 "geometry → geometry\n"
1243 "<h4>Example</h4>\n"
1244 "<pre> within( geomFromWKT( 'POINT( 0.5 0.5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) → returns 1</pre>\n"
1245 "<pre> within( geomFromWKT( 'POINT( 5 5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) → returns 0</pre>\n"
1247 gFunctionHelpTexts.insert(
"$page", QCoreApplication::translate(
"function_help",
"<h3>$page function</h3>\n"
1248 "Returns the current page number within a composition.\n"
1251 "<pre>$page</pre>\n"
1253 "<h4>Arguments</h4>\n"
1256 "<h4>Example</h4>\n"
1257 "<pre>$page → 2</pre>\n"
1260 gFunctionHelpTexts.insert(
"geomFromGML", QCoreApplication::translate(
"function_help",
"<h3>geomFromGML function</h3>\n"
1261 "Returns a geometry from a GML representation of geometry\n"
1264 "<pre>geomFromGML(text)</pre>\n"
1266 "<h4>Arguments</h4>\n"
1267 "text → GML representation of a geometry\n"
1269 "<h4>Example</h4>\n"
1270 "<pre> geomFromGML( '<gml:LineString srsName=\"EPSG:4326\"><gml:coordinates>4,4 5,5 6,6</gml:coordinates></gml:LineString>') → returns a geometry</pre>\n"
1273 gFunctionHelpTexts.insert(
"clamp", QCoreApplication::translate(
"function_help",
"<h3>clamp() function</h3>\n"
1274 "Restricts an input value to a specified range.\n"
1276 "<p><h4>Syntax</h4>\n"
1277 " clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>\n"
1279 "<p><h4>Arguments</h4>\n"
1280 "<!-- List args for functions here-->\n"
1281 "<i> minimum</i> → The smallest value <i>input</i> is allowed to take.<br>\n"
1282 "<i> input</i> → a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>\n"
1283 "<i> maximum</i> → The largest value <i>input</i> is allowed to take.<br>\n"
1285 "<h4>Example</h4>\n"
1286 "<!-- Show example of function.-->\n"
1287 " clamp(1,5,10) → 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>\n"
1288 " clamp(1,0,10) → 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>\n"
1289 " clamp(1,11,10) → 10 (<i>input</i> is greater than maximum value of 10, so function returns 10)<br>\n"
1293 gFunctionHelpTexts.insert(
"concat", QCoreApplication::translate(
"function_help",
"<h3>concat() function</h3>\n"
1294 "Concatenates several strings to one.\n"
1297 " concat(<i>string<i>[,<i>string</i>...])\n"
1299 "<h4>Arguments</h4>\n"
1300 "<!-- List args for functions here-->\n"
1301 "<i> string</i> → is string. a string.<br>\n"
1303 "<h4>Example</h4>\n"
1304 "<!-- Show example of function.-->\n"
1305 " concat('a','b','c','d','e') → 'abcde'\n"
1307 gFunctionHelpTexts.insert(
"atan", QCoreApplication::translate(
"function_help",
"<h3>atan() function</h3>\n"
1308 "Returns arcustanget of a value in radians.\n"
1311 "<p><h4>Syntax</h4>\n"
1312 " atan(<i>real</i>)</p>\n"
1314 "<p><h4>Arguments</h4>\n"
1315 "<i>real</i> → tan of an angle.</p>\n"
1317 "<p><h4>Example</h4>\n"
1318 " atan(0.5) → 0.463647609000806</p>\n"
1320 gFunctionHelpTexts.insert(
"cos", QCoreApplication::translate(
"function_help",
"<h3>cos() function</h3>\n"
1321 "Returns cosinus of an angle.\n"
1324 "<p><h4>Syntax</h4>\n"
1325 " cos(<i>real</i>)</p>\n"
1327 "<p><h4>Arguments</h4>\n"
1328 "<i>real</i> → angle in radians.</p>\n"
1330 "<p><h4>Example</h4>\n"
1331 " cos(1.571) → 0.000796326710733263</p>\n"
1333 gFunctionHelpTexts.insert(
"min", QCoreApplication::translate(
"function_help",
"<h3>min() function</h3>\n"
1334 "Returns the smallest value in a set of values.\n"
1337 " min(<i>value<i>[,<i>value</i>...])\n"
1339 "<h4>Arguments</h4>\n"
1340 "<!-- List args for functions here-->\n"
1341 "<i> value</i> → a number.<br>\n"
1343 "<h4>Example</h4>\n"
1344 "<!-- Show example of function.-->\n"
1345 " min(20.5,10,6.2) → 6.2\n"
1347 gFunctionHelpTexts.insert(
"ceil", QCoreApplication::translate(
"function_help",
"<h3>ceil() function</h3>\n"
1348 "Rounds a number upwards.\n"
1351 "<code>ceil(value)</code><br>\n"
1353 "<h4>Arguments</h4>\n"
1354 "<code>value</code> - a number.\n"
1357 "<h4>Example</h4>\n"
1358 "<!-- Show example of function.-->\n"
1359 "<code>ceil(4.9) → 5</code><br>\n"
1360 "<code>ceil(-4.9) → -4</code><br>\n"
1362 gFunctionHelpTexts.insert(
"Color", QCoreApplication::translate(
"function_help",
"\n"
1363 "<h3>Color Group</h3>\n"
1364 "This group contains functions for manipulating colors\n"
1366 gFunctionHelpTexts.insert(
"regexp_match", QCoreApplication::translate(
"function_help",
"<h3>regexp_match() function</h3>\n"
1367 "Returns true if any part of a string matches the supplied regular expression.\n"
1369 "<p><h4>Syntax</h4>\n"
1370 " regexp_match(<i>string,regex</i>)</p>\n"
1372 "<p><h4>Arguments</h4>\n"
1373 "<!-- List args for functions here-->\n"
1374 "<i> string</i> → is string. The string to test against the regular expression.<br>\n"
1375 "<i> regex</i> → is string. The regular expression to test against. Backslash characters must be double escaped (eg \"\\s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
1377 "<p><h4>Example</h4>\n"
1378 "<!-- Show example of function.-->\n"
1379 " regexp_match('QGIS ROCKS','\\sROCKS') → 1</p>\n"
1381 gFunctionHelpTexts.insert(
"abs", QCoreApplication::translate(
"function_help",
"<h3>abs() function</h3>\n"
1382 "Returns the absolute value of a number.<br>\n"
1386 "abs(<i>value</i>)<br>\n"
1388 "<h4>Arguments</h4>\n"
1389 "<code>value</code> - a number.<br>\n"
1391 "<h4>Example</h4>\n"
1392 "<code>abs(-2) → 2</code><br>\n"
1394 gFunctionHelpTexts.insert(
"trim", QCoreApplication::translate(
"function_help",
"<h3>trim() function</h3>\n"
1395 "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.\n"
1397 "<p><h4>Syntax</h4>\n"
1398 " trim(<i>string</i>)</p>\n"
1400 "<p><h4>Arguments</h4>\n"
1401 "<!-- List args for functions here-->\n"
1402 "<i> string</i> → is string. The string to trim.</p>\n"
1404 "<p><h4>Example</h4>\n"
1405 "<!-- Show example of function.-->\n"
1406 " trim(' hello world ') → 'hello world'</p>\n"
1408 gFunctionHelpTexts.insert(
"Operators", QCoreApplication::translate(
"function_help",
"<h3>Operators Group</h3>\n"
1409 "This group contains operators e.g + - * \n"
1411 gFunctionHelpTexts.insert(
"month", QCoreApplication::translate(
"function_help",
"<h3>month() function</h3>\n"
1412 "Extract the month part from a date, or the number of months\n"
1413 "from a <code>Interval</code>\n"
1416 "<code>month(date)</code><br>\n"
1417 "<code>month(Interval)</code><br>\n"
1419 "<h4>Arguments</h4>\n"
1420 "<code>date</code> - is date or datetime. The date to extract the month from.\n"
1422 "<code>Interval</code> - is Interval. The Interval to return the number of months from.\n"
1424 "<h4>Example</h4>\n"
1425 "<!-- Show example of function.-->\n"
1426 "<code>month('2012-05-12') → 05</code><br>\n"
1427 "<code>month(tointerval('3 months')) → 3</code><br>\n"
1428 "<code>month(age('2012-01-01','2010-01-01')) → 4.033...</code><br>\n"
1431 gFunctionHelpTexts.insert(
"geomToWKT", QCoreApplication::translate(
"function_help",
"<h3>geomToWKT function</h3>\n"
1432 "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata.\n"
1435 "<pre>geomToWKT(a)</pre>\n"
1437 "<h4>Arguments</h4>\n"
1438 "a → geometry\n"
1440 "<h4>Example</h4>\n"
1441 "<pre> geomToWKT( $geometry ) → POINT(6 50)</pre>\n"
1443 gFunctionHelpTexts.insert(
"CASE ELSE", QCoreApplication::translate(
"function_help",
"<h3>CASE expression</h3>\n"
1444 "A conditional expression that can be used to evaluate multiple expressions and\n"
1445 "return a result.\n"
1450 " WHEN <i>condition</i> THEN <i>result</i>\n"
1452 " [ ELSE <i>result</i> ]\n"
1455 "[ ] marks optional components\n"
1457 "<h4>Arguments</h4>\n"
1458 "<!-- List args for functions here-->\n"
1459 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
1460 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
1461 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
1463 "<h4>Example</h4>\n"
1464 "<!-- Show example of function.-->\n"
1467 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
1468 " ELSE <i>\"column\"</i>\n"
1472 gFunctionHelpTexts.insert(
"todate", QCoreApplication::translate(
"function_help",
"<h3>todate() function</h3>\n"
1473 "Convert a string into Qt data type.\n"
1476 "<code>todate('string')</code><br>\n"
1478 "<h4>Arguments</h4>\n"
1479 "<code>string</code> - is string in Qt date format.\n"
1482 "<h4>Example</h4>\n"
1483 "<!-- Show example of function.-->\n"
1484 "<code>todate('2012-05-04') → 2012-05-04</code><br>") );
1485 gFunctionHelpTexts.insert(
"hour", QCoreApplication::translate(
"function_help",
"<h3>hour() function</h3>\n"
1486 "Extract the hour from a datetime or time, or the number of hours\n"
1487 "from a <code>Interval</code>\n"
1490 "<code>hour(datetime)</code><br>\n"
1491 "<code>hour(Interval)</code><br>\n"
1493 "<h4>Arguments</h4>\n"
1494 "<code>date</code> - is datetime or time. The date to extract the hour from.\n"
1496 "<code>Interval</code> - is Interval. The Interval to return the number of hours from.\n"
1498 "<h4>Example</h4>\n"
1499 "<!-- Show example of function.-->\n"
1500 "<code>hour('2012-07-22T13:24:57') → 13</code><br>\n"
1501 "<code>hour(tointerval('3 hours')) → 3</code><br>\n"
1502 "<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) → 3</code><br>\n"
1503 "<code>hour(age('2012-01-01','2010-01-01')) → 17520</code><br>\n"
1506 gFunctionHelpTexts.insert(
"$id", QCoreApplication::translate(
"function_help",
"<h3>$id function</h3>\n"
1507 "Returns the feature id of the current row.\n"
1512 "<h4>Arguments</h4>\n"
1515 "<h4>Example</h4>\n"
1516 "<pre>$id → 42</pre>\n"
1519 gFunctionHelpTexts.insert(
"age", QCoreApplication::translate(
"function_help",
"<h3>age() function</h3>\n"
1520 "Returns the difference between two dates.\n"
1522 "The difference is returned as a <code>Interval</code> \n"
1523 "and needs to be used with one of the following functions\n"
1524 "in order to extract useful information:\n"
1526 "<li><code>year</code>\n"
1527 "<li><code>month</code>\n"
1528 "<li><code>week</code>\n"
1529 "<li><code>day</code>\n"
1530 "<li><code>hour</code>\n"
1531 "<li><code>minute</code>\n"
1532 "<li><code>second</code>\n"
1535 "<code>age(string,string)</code><br>\n"
1536 "<code>age(datetime,datetime)</code><br>\n"
1537 "<code>age(string,datetime)</code><br>\n"
1538 "<code>age(datetime,string)</code><br>\n"
1540 "<h4>Arguments</h4>\n"
1541 "<code>string</code> - is string. A string in date format.\n"
1543 "<code>datetime</code> - is date or datetime. A date or datetime type.\n"
1545 "<h4>Example</h4>\n"
1546 "<!-- Show example of function.-->\n"
1547 "<code>age('2012-05-12','2012-05-2') → Interval</code><br>\n"
1548 "use <code>day</code> to extract number of days<br>\n"
1549 "<code>day(age('2012-05-12','2012-05-2')) → 10</code><br>\n"
1552 gFunctionHelpTexts.insert(
"LIKE", QCoreApplication::translate(
"function_help",
"<h3>LIKE expression</h3>\n"
1553 "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also.\n"
1556 "<pre>string/number LIKE pattern</pre>\n"
1558 "<h4>Arguments</h4>\n"
1561 "<h4>Example</h4>\n"
1562 "<pre> 'A' LIKE 'A' → returns 1 </pre>\n"
1563 "<pre> 'A' LIKE 'a' → returns 0 </pre>\n"
1564 "<pre> 'A' LIKE 'B' → returns 0 </pre>\n"
1566 gFunctionHelpTexts.insert(
"overlaps", QCoreApplication::translate(
"function_help",
"<h3>overlaps function</h3>\n"
1567 "Returns 1 if the geometries share space, are of the same dimension, but are not completely contained by each other.\n"
1570 "<pre>overlaps( a, b )</pre>\n"
1572 "<h4>Arguments</h4>\n"
1573 "a → geometry\n"
1574 "b → geometry\n"
1576 "<h4>Example</h4>\n"
1577 "<pre> overlaps( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 5 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
1578 "<pre> overlaps( geomFromWKT( 'LINESTRING(0 0 , 1 1)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 0</pre>\n"
1580 gFunctionHelpTexts.insert(
"intersection", QCoreApplication::translate(
"function_help",
"<h3>intersection function</h3>\n"
1581 "Returns a geometry that represents the shared portion of geometry a and geometry b.\n"
1584 "<pre>intersection( geometry a , geometry b)</pre>\n"
1586 "<h4>Arguments</h4>\n"
1587 "geometry → geometry\n"
1588 "geometry → geometry\n"
1590 "<h4>Example</h4>\n"
1591 "<pre> geomToWKT( intersection( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 )' )) ) → returns LINESTRING(3 3, 4 4)</pre>\n"
1593 gFunctionHelpTexts.insert(
"exp", QCoreApplication::translate(
"function_help",
"<h3>exp() function</h3>\n"
1594 "Returns exponential of an value.\n"
1597 "<p><h4>Syntax</h4>\n"
1598 " exp(<i>real</i>)</p>\n"
1600 "<p><h4>Arguments</h4>\n"
1601 "<i>real</i> → number.</p>\n"
1603 "<p><h4>Example</h4>\n"
1604 " exp(1.0) → 2.71828182845905</p>\n"
1606 gFunctionHelpTexts.insert(
"CASE", QCoreApplication::translate(
"function_help",
"<h3>CASE expression</h3>\n"
1607 "A conditional expression that can be used to evaluate multiple expressions and\n"
1608 "return a result.\n"
1613 " WHEN <i>condition</i> THEN <i>result</i>\n"
1615 " [ ELSE <i>result</i> ]\n"
1618 "[ ] marks optional components\n"
1620 "<h4>Arguments</h4>\n"
1621 "<!-- List args for functions here-->\n"
1622 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
1623 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
1624 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
1626 "<h4>Example</h4>\n"
1627 "<!-- Show example of function.-->\n"
1630 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
1634 gFunctionHelpTexts.insert(
"$area", QCoreApplication::translate(
"function_help",
"<h3>$area function</h3>\n"
1635 "Returns the area size of the current feature.\n"
1638 "<pre>$area</pre>\n"
1640 "<h4>Arguments</h4>\n"
1643 "<h4>Example</h4>\n"
1644 "<pre>$area → 42</pre>\n"
1647 gFunctionHelpTexts.insert(
"Field", QCoreApplication::translate(
"function_help",
"<h3>Field</h3>\n"
1648 "Double click to add field name to expression string.\n"
1650 "Right-Click on field name to open context menu sample value loading options.\n"
1652 "<p><h4>Note:</h4>\n"
1653 "Loading field values from WFS layers isn't supported, before the layer is\n"
1654 "actually inserted, ie. when building queries.\n"
1657 gFunctionHelpTexts.insert(
"ILIKE", QCoreApplication::translate(
"function_help",
"<h3>ILIKE expression</h3>\n"
1658 "Returns 1 if the first parameter matches case-insensitive the supplied pattern. LIKE can be used instead of ILIKE to make the match case-sensitive. Works with numbers also.\n"
1661 "<pre>string/number ILIKE pattern</pre>\n"
1663 "<h4>Arguments</h4>\n"
1666 "<h4>Example</h4>\n"
1667 "<pre> 'A' ILIKE 'A' → returns 1 </pre>\n"
1668 "<pre> 'A' ILIKE 'a' → returns 1 </pre>\n"
1669 "<pre> 'A' ILIKE 'B' → returns 0 </pre>\n"
1671 gFunctionHelpTexts.insert(
"$perimeter", QCoreApplication::translate(
"function_help",
"<h3>$perimeter function</h3>\n"
1672 "Returns the perimeter length of the current feature.\n"
1675 "<pre>$perimeter</pre>\n"
1677 "<h4>Arguments</h4>\n"
1680 "<h4>Example</h4>\n"
1681 "<pre>$perimeter → 42</pre>\n"
1684 gFunctionHelpTexts.insert(
"$numfeatures", QCoreApplication::translate(
"function_help",
"<h3>$numfeatures function</h3>\n"
1685 "In atlas generation, returns the total number of features within the coverage layer.\n"
1688 "<pre>$numfeatures</pre>\n"
1690 "<h4>Arguments</h4>\n"
1693 "<h4>Example</h4>\n"
1694 "<pre>$numfeatures → 42</pre>\n"
1697 gFunctionHelpTexts.insert(
"touches", QCoreApplication::translate(
"function_help",
"<h3>touches function</h3>\n"
1698 "Returns 1 if the geometries have at least one point in common, but their interiors do not intersect.\n"
1701 "<pre>touches( a, b )</pre>\n"
1703 "<h4>Arguments</h4>\n"
1704 "a → geometry\n"
1705 "b → geometry\n"
1707 "<h4>Example</h4>\n"
1708 "<pre> touches( geomFromWKT( 'LINESTRING(5 3 , 4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
1709 "<pre> touches( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) → returns 0</pre>\n"
1711 gFunctionHelpTexts.insert(
"contains", QCoreApplication::translate(
"function_help",
"<h3>contains function</h3>\n"
1712 " Returns true if and only if no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a. \n"
1715 "<pre>contains( geometry a , geometry a)</pre>\n"
1717 "<h4>Arguments</h4>\n"
1718 "geometry → geometry\n"
1719 "geometry → geometry\n"
1721 "<h4>Example</h4>\n"
1722 "<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'POINT( 0.5 0.5 )' )) → returns 1</pre>\n"
1723 "<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 0</pre>\n"
1725 gFunctionHelpTexts.insert(
"format_number", QCoreApplication::translate(
"function_help",
"<h3>format_number() function</h3>\n"
1726 "Returns a number formatted with the locale separator for thousands. \n"
1727 "Also truncates the number to the number of supplied places. \n"
1729 "<code>format_number(number,places)</code><br>\n"
1731 "<h4>Arguments</h4>\n"
1732 "<code>number</code> - is number. The number to be formatted.\n"
1734 "<code>places</code> - is int. The number of decimal places to truncate the string\n"
1737 "<h4>Example</h4>\n"
1738 "<!-- Show example of function.-->\n"
1739 "<code>format_number(10000000.332,2) → 10,000,000.33</code>\n"
1742 gFunctionHelpTexts.insert(
"xat", QCoreApplication::translate(
"function_help",
"<h3>xat() function</h3>\n"
1743 "Retrieves a x coordinate of the current feature\n"
1746 "<code>xat(i)</code>\n"
1748 "<h4>Arguments</h4>\n"
1749 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
1751 "<h4>Example</h4>\n"
1752 "<pre>xat(1) → 5</pre>\n"
1754 gFunctionHelpTexts.insert(
"color_hsla", QCoreApplication::translate(
"function_help",
"<h3>color_hsla() function</h3>\n"
1755 "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes\n"
1757 "<p><h4>Syntax</h4>\n"
1758 " color_hsla(<i>hue, saturation, lightness, alpha</i>)</p>\n"
1760 "<p><h4>Arguments</h4>\n"
1761 "<!-- List args for functions here-->\n"
1762 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
1763 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1764 "<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
1765 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1767 "<p><h4>Example</h4>\n"
1768 "<!-- Show example of function.-->\n"
1769 " color_hsla(100,50,70,200) → '166,217,140,200'</p>\n"
1771 gFunctionHelpTexts.insert(
"AND", QCoreApplication::translate(
"function_help",
"<h3>AND logical operator</h3>\n"
1772 "Returns 1 when condition a and b are true.\n"
1775 "<pre> condition a AND condition b </pre>\n"
1777 "<h4>Arguments</h4>\n"
1780 "<h4>Example</h4>\n"
1781 "<pre> 4 = 2+2 AND 1 = 1 → returns 1 </pre>\n"
1782 "<pre> 4 = 2+2 AND 1 = 2 → returns 0 </pre>\n"
1785 gFunctionHelpTexts.insert(
"yat", QCoreApplication::translate(
"function_help",
"<h3>yat() function</h3>\n"
1786 "Retrieves a y coordinate of the current feature\n"
1789 "<code>yat(i)</code>\n"
1791 "<h4>Arguments</h4>\n"
1792 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
1794 "<h4>Example</h4>\n"
1795 "<pre>yat(1) → 5</pre>\n"
1797 gFunctionHelpTexts.insert(
"union", QCoreApplication::translate(
"function_help",
"<h3>union function</h3>\n"
1798 "Returns a geometry that represents the point set union of the geometries.\n"
1801 "<pre>union( a, b )</pre>\n"
1803 "<h4>Arguments</h4>\n"
1804 "a → geometry\n"
1805 "b → geometry\n"
1807 "<h4>Example</h4>\n"
1808 "<pre> geomToWKT( union( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) ) → returns MULTIPOINT(4 4, 5 5)</pre>\n"
1810 gFunctionHelpTexts.insert(
"second", QCoreApplication::translate(
"function_help",
"<h3>second() function</h3>\n"
1811 "Extract the seconds from a datetime or time, or the number of seconds\n"
1812 "from a <code>Interval</code>\n"
1815 "<code>second(datetime)</code><br>\n"
1816 "<code>second(Interval)</code><br>\n"
1818 "<h4>Arguments</h4>\n"
1819 "<code>date</code> - is datetime or time. The date to extract the second from.\n"
1821 "<code>Interval</code> - is Interval. The Interval to return the number of seconds from.\n"
1823 "<h4>Example</h4>\n"
1824 "<!-- Show example of function.-->\n"
1825 "<code>second('2012-07-22T13:24:57') → 57</code><br>\n"
1826 "<code>second(tointerval('3 seconds')) → 3</code><br>\n"
1827 "<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) → 1200</code><br>\n"
1828 "<code>second(age('2012-01-01','2010-01-01')) → 63072000</code><br>\n"
1831 gFunctionHelpTexts.insert(
"ramp_color", QCoreApplication::translate(
"function_help",
"\n"
1832 "<h3>ramp_color() function</h3>\n"
1833 "Returns a string representing a color from a color ramp. \n"
1835 "<p><h4>Syntax</h4>\n"
1836 " ramp_color(<i>ramp_name,value</i>)</p>\n"
1838 "<p><h4>Arguments</h4>\n"
1839 "<!-- List args for functions here-->\n"
1840 "<i> ramp_name</i> → the name of the color ramp as a string, for example 'Spectral'.<br>\n"
1841 "<i> value</i> → the position on the ramp to select the color from as a real number between 0 and 1.<br>\n"
1843 "<p><h4>Example</h4>\n"
1844 "<!-- Show example of function.-->\n"
1845 " ramp_color('Spectral',0.3) → '#fdbe73'</p>\n"
1847 "<p><h4>Note:</h4>\n"
1848 "The color ramps available vary between QGIS installations. This function\n"
1849 "may not give the expected results if you move your Quantum project.\n"
1852 gFunctionHelpTexts.insert(
"color_hsv", QCoreApplication::translate(
"function_help",
"<h3>color_hsv() function</h3>\n"
1853 "Returns a string representation of a color based on its hue, saturation, and value attributes\n"
1855 "<p><h4>Syntax</h4>\n"
1856 " color_hsv(<i>hue, saturation, value</i>)</p>\n"
1858 "<p><h4>Arguments</h4>\n"
1859 "<!-- List args for functions here-->\n"
1860 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
1861 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1862 "<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br>\n"
1864 "<p><h4>Example</h4>\n"
1865 "<!-- Show example of function.-->\n"
1866 " color_hsv(40,100,100) → '#ffaa00'</p>\n"
1868 gFunctionHelpTexts.insert(
"Fields and Values", QCoreApplication::translate(
"function_help",
"<h3>Fields and Values</h3>\n"
1869 "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\n"
1871 "Select the field name from the list then right-click to access context menu with options to load sample values from the selected field.\n"
1873 "<p><h4>Note:</h4>\n"
1874 "Loading field values from WFS layers isn't supported, before the layer is\n"
1875 "actually inserted, ie. when building queries.\n"
1878 gFunctionHelpTexts.insert(
"toreal", QCoreApplication::translate(
"function_help",
"<h3>toreal() function</h3>\n"
1879 "Converts a string to real number. Nothing changed if a value cannot be converted to real (e.g '123.56asd' is invalid). Numbers are rounded after saving changes if the precision is smaller than the result of the conversion.\n"
1881 "<p><h4>Syntax</h4>\n"
1882 " toreal(<i>string</i>)</p>\n"
1884 "<p><h4>Arguments</h4>\n"
1885 "<!-- List args for functions here-->\n"
1886 "<i> string</i> → is string. The String to convert to real number.</p>\n"
1888 "<p><h4>Example</h4>\n"
1889 "<!-- Show example of function.-->\n"
1890 " toreal('123.45') → 123.45</p>\n"
1892 gFunctionHelpTexts.insert(
"scale_linear", QCoreApplication::translate(
"function_help",
"<h3>scale_linear() function</h3>\n"
1893 "Transforms a given value from an input domain to an output range using linear interpolation. \n"
1895 "<p><h4>Syntax</h4>\n"
1896 " scale_linear(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>)</p>\n"
1898 "<p><h4>Arguments</h4>\n"
1899 "<!-- List args for functions here-->\n"
1900 "<i> val</i> → is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
1901 "<i> domain_min, domain_max</i> → specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
1902 "<i> range_min, range_max</i> → specify the output range, the smallest and largest values which should be output by the function.<br>\n"
1904 "<h4>Example</h4>\n"
1905 "<!-- Show example of function.-->\n"
1906 " scale_linear(5,0,10,0,100) → 50<br>\n"
1907 " scale_linear(0.2,0,1,0,360) → 72 <i>(eg, scaling a value between 0 and 1 to an angle between 0 and 360)</i><br>\n"
1908 " scale_linear(1500,1000,10000,9,20) → 10.22 <i>(eg, scaling a population which varies between 1000 and 10000 to a font size between 9 and 20)</i><br>\n"
1912 gFunctionHelpTexts.insert(
"crosses", QCoreApplication::translate(
"function_help",
"<h3>crosses function</h3>\n"
1913 "Returns 1 if the supplied geometries have some, but not all, interior points in common.\n"
1916 "<pre>crosses( $geometry , $geometry)</pre>\n"
1918 "<h4>Arguments</h4>\n"
1919 "geometry → geometry\n"
1920 "geometry → geometry\n"
1922 "<h4>Example</h4>\n"
1923 "<pre> crosses( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
1924 "<pre> crosses( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 0</pre>\n"
1926 gFunctionHelpTexts.insert(
"$pi", QCoreApplication::translate(
"function_help",
"<h3>$pi constant</h3>\n"
1927 "Returns pi as value for calculations\n"
1932 "<h4>Arguments</h4>\n"
1935 "<h4>Example</h4>\n"
1936 "<pre>$pi → 3.14159265358979</pre>\n"
1938 gFunctionHelpTexts.insert(
"$y", QCoreApplication::translate(
"function_help",
"<h3>$y function</h3>\n"
1939 "Returns the y coordinate of the current feature.\n"
1944 "<h4>Arguments</h4>\n"
1947 "<h4>Example</h4>\n"
1948 "<pre>$y → 42</pre>\n"
1951 gFunctionHelpTexts.insert(
"format", QCoreApplication::translate(
"function_help",
"<h3>format() function</h3>\n"
1952 "Format a string using supplied arguments. \n"
1955 "<code>format('string', arg, [arg...n])</code><br>\n"
1957 "<h4>Arguments</h4>\n"
1958 "<code>string</code> - is string. String with Qt QString place holders. Use %1, %2, etc for placeholders. Placeholders can be repeated. \n"
1960 "<code>arg [arg...n]</code> - any type. Any number of args. \n"
1962 "<h4>Example</h4>\n"
1963 "<!-- Show example of function.-->\n"
1964 "<code>format('This %1 a %2','is', 'test') → This is a test</code><br>") );
1965 gFunctionHelpTexts.insert(
"upper", QCoreApplication::translate(
"function_help",
"<h3>upper() function</h3>\n"
1966 "Converts a string to upper case letters.\n"
1968 "<p><h4>Syntax</h4>\n"
1969 " upper(<i>string</i>)</p>\n"
1971 "<p><h4>Arguments</h4>\n"
1972 "<!-- List args for functions here-->\n"
1973 "<i> string</i> → is string. The String to convert to upper case.</p>\n"
1975 "<p><h4>Example</h4>\n"
1976 "<!-- Show example of function.-->\n"
1977 " upper('hello WOrld') → 'HELLO WORLD'</p>\n"
static QHash< QString, QString > gFunctionHelpTexts
static void initFunctionHelp()