2 #include <QCoreApplication>
11 gFunctionHelpTexts.insert(
"ramp_color", QCoreApplication::translate(
"function_help",
"\n"
12 "<h3>ramp_color() function</h3>\n"
13 "Returns a string representing a color from a color ramp. \n"
15 "<p><h4>Syntax</h4>\n"
16 " ramp_color(<i>ramp_name,value</i>)</p>\n"
18 "<p><h4>Arguments</h4>\n"
19 "<!-- List args for functions here-->\n"
20 "<i> ramp_name</i> → the name of the color ramp as a string, for example 'Spectral'.<br>\n"
21 "<i> value</i> → the position on the ramp to select the color from as a real number between 0 and 1.<br>\n"
23 "<p><h4>Example</h4>\n"
24 "<!-- Show example of function.-->\n"
25 " ramp_color('Spectral',0.3) → '#fdbe73'</p>\n"
28 "The color ramps available vary between QGIS installations. This function\n"
29 "may not give the expected results if you move your Quantum project.\n"
32 gFunctionHelpTexts.insert(
"rand", QCoreApplication::translate(
"function_help",
"<h3>rand() function</h3>\n"
33 "Returns a random integer within the range specified by the minimum and \n"
34 "maximum argument (inclusive).\n"
36 "This function takes two arguments.\n"
38 "<code>rand(min, max)</code><br>\n"
40 "<h4>Arguments</h4>\n"
41 "<code>min</code> - an integer representing the smallest possible random number desired.<br>\n"
42 "<code>max</code> - an integer representing the largest possible random number desired.\n"
46 "<!-- Show example of function.-->\n"
47 "<code>rand(1, 10) → 8</code><br>\n"
49 gFunctionHelpTexts.insert(
"within", QCoreApplication::translate(
"function_help",
"<h3>within function</h3>\n"
50 "Returns 1 if the geometry a is completely inside geometry b\n"
53 "<pre>within( geometry a , geometry b)</pre>\n"
55 "<h4>Arguments</h4>\n"
56 "geometry → geometry\n"
57 "geometry → geometry\n"
60 "<pre> within( geomFromWKT( 'POINT( 0.5 0.5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) → returns 1</pre>\n"
61 "<pre> within( geomFromWKT( 'POINT( 5 5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) → returns 0</pre>\n"
63 gFunctionHelpTexts.insert(
"disjoint", QCoreApplication::translate(
"function_help",
"<h3>disjoint function</h3>\n"
64 "Returns 1 if the geometries do not \"spatially intersect\" - if they do not share any space together. \n"
67 "<pre>disjoint( a, b )</pre>\n"
69 "<h4>Arguments</h4>\n"
74 "<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"
75 "<pre> disjoint( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'POINT(4 4)' )) → returns 0</pre>\n"
77 gFunctionHelpTexts.insert(
"month", QCoreApplication::translate(
"function_help",
"<h3>month() function</h3>\n"
78 "Extract the month part from a date, or the number of months\n"
79 "from a <code>Interval</code>\n"
82 "<code>month(date)</code><br>\n"
83 "<code>month(Interval)</code><br>\n"
85 "<h4>Arguments</h4>\n"
86 "<code>date</code> - is date or datetime. The date to extract the month from.\n"
88 "<code>Interval</code> - is Interval. The Interval to return the number of months from.\n"
91 "<!-- Show example of function.-->\n"
92 "<code>month('2012-05-12') → 05</code><br>\n"
93 "<code>month(tointerval('3 months')) → 3</code><br>\n"
94 "<code>month(age('2012-01-01','2010-01-01')) → 4.033...</code><br>\n"
97 gFunctionHelpTexts.insert(
"Field", QCoreApplication::translate(
"function_help",
"<h3>Field</h3>\n"
98 "Double click to add field name to expression string.\n"
100 "Right-Click on field name to open context menu sample value loading options.\n"
102 "<p><h4>Note:</h4>\n"
103 "Loading field values from WFS layers isn't supported, before the layer is\n"
104 "actually inserted, ie. when building queries.\n"
107 gFunctionHelpTexts.insert(
"yat", QCoreApplication::translate(
"function_help",
"<h3>yat() function</h3>\n"
108 "Retrieves a y coordinate of the current feature\n"
111 "<code>yat(i)</code>\n"
113 "<h4>Arguments</h4>\n"
114 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
117 "<pre>yat(1) → 5</pre>\n"
119 gFunctionHelpTexts.insert(
"intersection", QCoreApplication::translate(
"function_help",
"<h3>intersection function</h3>\n"
120 "Returns a geometry that represents the shared portion of geometry a and geometry b.\n"
123 "<pre>intersection( geometry a , geometry b)</pre>\n"
125 "<h4>Arguments</h4>\n"
126 "geometry → geometry\n"
127 "geometry → geometry\n"
130 "<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"
132 gFunctionHelpTexts.insert(
"centroid", QCoreApplication::translate(
"function_help",
"<h3>centroid function</h3>\n"
133 "Returns the geometric center of a geometry.\n"
136 "<pre>centroid(a)</pre>\n"
138 "<h4>Arguments</h4>\n"
139 "b → geometry\n"
142 "<pre> centroid($geometry) → returns a point geometry</pre>\n"
145 gFunctionHelpTexts.insert(
"cos", QCoreApplication::translate(
"function_help",
"<h3>cos() function</h3>\n"
146 "Returns cosinus of an angle.\n"
149 "<p><h4>Syntax</h4>\n"
150 " cos(<i>real</i>)</p>\n"
152 "<p><h4>Arguments</h4>\n"
153 "<i>real</i> → angle in radians.</p>\n"
155 "<p><h4>Example</h4>\n"
156 " cos(1.571) → 0.000796326710733263</p>\n"
158 gFunctionHelpTexts.insert(
"second", QCoreApplication::translate(
"function_help",
"<h3>second() function</h3>\n"
159 "Extract the seconds from a datetime or time, or the number of seconds\n"
160 "from a <code>Interval</code>\n"
163 "<code>second(datetime)</code><br>\n"
164 "<code>second(Interval)</code><br>\n"
166 "<h4>Arguments</h4>\n"
167 "<code>date</code> - is datetime or time. The date to extract the second from.\n"
169 "<code>Interval</code> - is Interval. The Interval to return the number of seconds from.\n"
172 "<!-- Show example of function.-->\n"
173 "<code>second('2012-07-22T13:24:57') → 57</code><br>\n"
174 "<code>second(tointerval('3 seconds')) → 3</code><br>\n"
175 "<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) → 1200</code><br>\n"
176 "<code>second(age('2012-01-01','2010-01-01')) → 63072000</code><br>\n"
179 gFunctionHelpTexts.insert(
"geomToWKT", QCoreApplication::translate(
"function_help",
"<h3>geomToWKT function</h3>\n"
180 "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata.\n"
183 "<pre>geomToWKT(a)</pre>\n"
185 "<h4>Arguments</h4>\n"
186 "a → geometry\n"
189 "<pre> geomToWKT( $geometry ) → POINT(6 50)</pre>\n"
191 gFunctionHelpTexts.insert(
"touches", QCoreApplication::translate(
"function_help",
"<h3>touches function</h3>\n"
192 "Returns 1 if the geometries have at least one point in common, but their interiors do not intersect.\n"
195 "<pre>touches( a, b )</pre>\n"
197 "<h4>Arguments</h4>\n"
198 "a → geometry\n"
199 "b → geometry\n"
202 "<pre> touches( geomFromWKT( 'LINESTRING(5 3 , 4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
203 "<pre> touches( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) → returns 0</pre>\n"
205 gFunctionHelpTexts.insert(
"randf", QCoreApplication::translate(
"function_help",
"<h3>randf() function</h3>\n"
206 "Returns a random float within the range specified by the minimum and \n"
207 "maximum argument (inclusive).\n"
209 "This function takes two arguments.\n"
211 "<code>randf(min, max)</code><br>\n"
213 "<h4>Arguments</h4>\n"
214 "<code>min</code> - a float representing the smallest possible random number desired.<br>\n"
215 "<code>max</code> - a float representing the largest possible random number desired.\n"
219 "<!-- Show example of function.-->\n"
220 "<code>randf(1, 10) → 4.59258286403147</code><br>\n"
222 gFunctionHelpTexts.insert(
"abs", QCoreApplication::translate(
"function_help",
"<h3>abs() function</h3>\n"
223 "Returns the absolute value of a number.<br>\n"
227 "abs(<i>value</i>)<br>\n"
229 "<h4>Arguments</h4>\n"
230 "<code>value</code> - a number.<br>\n"
233 "<code>abs(-2) → 2</code><br>\n"
235 gFunctionHelpTexts.insert(
"$numfeatures", QCoreApplication::translate(
"function_help",
"<h3>$numfeatures function</h3>\n"
236 "In atlas generation, returns the total number of features within the coverage layer.\n"
239 "<pre>$numfeatures</pre>\n"
241 "<h4>Arguments</h4>\n"
245 "<pre>$numfeatures → 42</pre>\n"
248 gFunctionHelpTexts.insert(
"union", QCoreApplication::translate(
"function_help",
"<h3>union function</h3>\n"
249 "Returns a geometry that represents the point set union of the geometries.\n"
252 "<pre>union( a, b )</pre>\n"
254 "<h4>Arguments</h4>\n"
255 "a → geometry\n"
256 "b → geometry\n"
259 "<pre> geomToWKT( union( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) ) → returns MULTIPOINT(4 4, 5 5)</pre>\n"
261 gFunctionHelpTexts.insert(
"color_rgb", QCoreApplication::translate(
"function_help",
"\n"
262 "<h3>color_rgb() function</h3>\n"
263 "Returns a string representation of a color based on its red, green, and blue components\n"
265 "<p><h4>Syntax</h4>\n"
266 " color_rgb(<i>red, green, blue</i>)</p>\n"
268 "<p><h4>Arguments</h4>\n"
269 "<!-- List args for functions here-->\n"
270 "<i> red</i> → the red component as an integer value from 0 to 255.<br>\n"
271 "<i> green</i> → the green component as an integer value from 0 to 255.<br>\n"
272 "<i> blue</i> → the blue component as an integer value from 0 to 255.<br>\n"
274 "<p><h4>Example</h4>\n"
275 "<!-- Show example of function.-->\n"
276 " color_rgb(255,127,0) → '#ff7f00'</p>\n"
278 gFunctionHelpTexts.insert(
"xat", QCoreApplication::translate(
"function_help",
"<h3>xat() function</h3>\n"
279 "Retrieves a x coordinate of the current feature\n"
282 "<code>xat(i)</code>\n"
284 "<h4>Arguments</h4>\n"
285 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
288 "<pre>xat(1) → 5</pre>\n"
290 gFunctionHelpTexts.insert(
"color_hsva", QCoreApplication::translate(
"function_help",
"<h3>color_hsva() function</h3>\n"
291 "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes\n"
293 "<p><h4>Syntax</h4>\n"
294 " color_hsva(<i>hue, saturation, value, alpha</i>)</p>\n"
296 "<p><h4>Arguments</h4>\n"
297 "<!-- List args for functions here-->\n"
298 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
299 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
300 "<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br>\n"
301 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
303 "<p><h4>Example</h4>\n"
304 "<!-- Show example of function.-->\n"
305 " color_hsva(40,100,100,200) → '255,170,0,200'</p>\n"
307 gFunctionHelpTexts.insert(
"$y", QCoreApplication::translate(
"function_help",
"<h3>$y function</h3>\n"
308 "Returns the y coordinate of the current feature.\n"
313 "<h4>Arguments</h4>\n"
317 "<pre>$y → 42</pre>\n"
320 gFunctionHelpTexts.insert(
"strpos", QCoreApplication::translate(
"function_help",
"<h3>strpos() function</h3>\n"
321 "Return the index of a regular expression in a string.\n"
324 " strpos(<i>haystack</i>, <i>needle</i>)\n"
326 "Returns -1 if the expression isn't found.\n"
328 "<p><h4>Arguments</h4>\n"
329 "<!-- List args for functions here-->\n"
330 "<i> haystack</i> → is string. The string that is to be searched.<br>\n"
331 "<i> needle</i> → is string. The regular expression to look for.<br>\n"
334 "<!-- Show example of function.-->\n"
335 " strpos('HELLO WORLD','WORLD') → 6<br>\n"
336 " strpos('HELLO WORLD','GOODBYE') → -1<br>\n"
338 gFunctionHelpTexts.insert(
"substr", QCoreApplication::translate(
"function_help",
"<h3>substr() function</h3>\n"
339 "Return a part of a string\n"
341 "<p><h4>Syntax</h4>\n"
342 " substr(<i>string,startpos,length</i>)</p>\n"
344 "<p><h4>Arguments</h4>\n"
345 "<!-- List args for functions here-->\n"
346 "<i> string</i> → is string. The full string.<br>\n"
347 "<i> startpos</i> → is number. The start position to extract from.<br>\n"
348 "<i> length</i> → is number. The length of the string to extract.<br></p>\n"
350 "<p><h4>Example</h4>\n"
351 "<!-- Show example of function.-->\n"
352 " substr('HELLO WORLD',3,5) → 'LLO W'</p>\n"
354 gFunctionHelpTexts.insert(
"right", QCoreApplication::translate(
"function_help",
"<h3>right() function</h3>\n"
355 "Returns a substring that contains the <i>n</i> rightmost characters of the string.\n"
358 "<code>right(string, pos)</code><br>\n"
360 "<h4>Arguments</h4>\n"
361 "<code>string</code> - is string. The string.\n"
363 "<code>length</code> - is int. The number of characters from the right to return.\n"
366 "<!-- Show example of function.-->\n"
367 "<code>right('Hello World',5) → 'World'</code><br>\n"
370 gFunctionHelpTexts.insert(
"bbox", QCoreApplication::translate(
"function_help",
"<h3>bbox function</h3>\n"
371 "Returns 1 if the geometries spatially intersect the bounding box defined and 0 if they don't.\n"
374 "<pre>bbox( a, b )</pre>\n"
376 "<h4>Arguments</h4>\n"
377 "a → geometry\n"
378 "b → geometry\n"
381 "<pre>bbox( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
382 "<pre>bbox( geomFromWKT( 'POINT(6 5)' ) , geomFromWKT( 'POLYGON((3 3 , 4 4 , 5 5, 3 3))' )) → returns 0</pre>\n"
384 gFunctionHelpTexts.insert(
"minute", QCoreApplication::translate(
"function_help",
"<h3>minute() function</h3>\n"
385 "Extract the minute from a datetime or time, or the number of minutes\n"
386 "from a <code>Interval</code>\n"
389 "<code>minute(datetime)</code><br>\n"
390 "<code>minute(Interval)</code><br>\n"
392 "<h4>Arguments</h4>\n"
393 "<code>date</code> - is datetime or time. The date to extract the minute from.\n"
395 "<code>Interval</code> - is Interval. The Interval to return the number of minutes from.\n"
398 "<!-- Show example of function.-->\n"
399 "<code>minute('2012-07-22T13:24:57') → 24</code><br>\n"
400 "<code>minute(tointerval('3 minutes')) → 3</code><br>\n"
401 "<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) → 20</code><br>\n"
402 "<code>minute(age('2012-01-01','2010-01-01')) → 1051200</code><br>\n"
405 gFunctionHelpTexts.insert(
"clamp", QCoreApplication::translate(
"function_help",
"<h3>clamp() function</h3>\n"
406 "Restricts an input value to a specified range.\n"
408 "<p><h4>Syntax</h4>\n"
409 " clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>\n"
411 "<p><h4>Arguments</h4>\n"
412 "<!-- List args for functions here-->\n"
413 "<i> minimum</i> → The smallest value <i>input</i> is allowed to take.<br>\n"
414 "<i> input</i> → a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>\n"
415 "<i> maximum</i> → The largest value <i>input</i> is allowed to take.<br>\n"
418 "<!-- Show example of function.-->\n"
419 " clamp(1,5,10) → 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>\n"
420 " clamp(1,0,10) → 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>\n"
421 " clamp(1,11,10) → 10 (<i>input</i> is greater than maximum value of 10, so function returns 10)<br>\n"
425 gFunctionHelpTexts.insert(
"scale_exp", QCoreApplication::translate(
"function_help",
"<h3>scale_exp() function</h3>\n"
426 "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"
427 "of the specified output range. \n"
429 "<p><h4>Syntax</h4>\n"
430 " 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"
432 "<p><h4>Arguments</h4>\n"
433 "<!-- List args for functions here-->\n"
434 "<i> val</i> → is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
435 "<i> domain_min, domain_max</i> → specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
436 "<i> range_min, range_max</i> → specify the output range, the smallest and largest values which should be output by the function.<br>\n"
437 "<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"
438 "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"
441 "<!-- Show example of function.-->\n"
442 "<b>Easing in, using an exponent of 2:</b><br>\n"
443 " scale_exp(5,0,10,0,100,2) → 25<br>\n"
444 " scale_exp(7.5,0,10,0,100,2) → 56.25<br>\n"
445 " scale_exp(9.5,0,10,0,100,2) → 90.25<br> \n"
447 "<b>Easing out, using an exponent of 0.5:</b><br> \n"
448 " scale_exp(3,0,10,0,100,0.5) → 54.772<br>\n"
449 " scale_exp(6,0,10,0,100,0.5) → 77.459<br>\n"
450 " scale_exp(9,0,10,0,100,0.5) → 94.868<br> \n"
454 gFunctionHelpTexts.insert(
"crosses", QCoreApplication::translate(
"function_help",
"<h3>crosses function</h3>\n"
455 "Returns 1 if the supplied geometries have some, but not all, interior points in common.\n"
458 "<pre>crosses( $geometry , $geometry)</pre>\n"
460 "<h4>Arguments</h4>\n"
461 "geometry → geometry\n"
462 "geometry → geometry\n"
465 "<pre> crosses( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
466 "<pre> crosses( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 0</pre>\n"
468 gFunctionHelpTexts.insert(
"concat", QCoreApplication::translate(
"function_help",
"<h3>concat() function</h3>\n"
469 "Concatenates several strings to one.\n"
472 " concat(<i>string<i>[,<i>string</i>...])\n"
474 "<h4>Arguments</h4>\n"
475 "<!-- List args for functions here-->\n"
476 "<i> string</i> → is string. a string.<br>\n"
479 "<!-- Show example of function.-->\n"
480 " concat('a','b','c','d','e') → 'abcde'\n"
482 gFunctionHelpTexts.insert(
"length", QCoreApplication::translate(
"function_help",
"<h3>length() function</h3>\n"
483 "Returns the length of a string.\n"
485 "<p><h4>Syntax</h4>\n"
486 " length(<i>string</i>)</p>\n"
488 "<p><h4>Arguments</h4>\n"
489 "<!-- List args for functions here-->\n"
490 "<i> string</i> → is string. The String to count the length of.</p>\n"
492 "<p><h4>Example</h4>\n"
493 "<!-- Show example of function.-->\n"
494 " length('HELLO') → 5</p>\n"
496 gFunctionHelpTexts.insert(
"distance", QCoreApplication::translate(
"function_help",
"<h3>distance function</h3>\n"
497 " Returns the minimum distance (based on spatial ref) between two geometries in projected units.\n"
500 "<pre>distance( a, b )</pre>\n"
502 "<h4>Arguments</h4>\n"
503 "a → geometry\n"
504 "b → geometry\n"
507 "<pre> distance( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(4 8)' )) → returns 4</pre>\n"
509 gFunctionHelpTexts.insert(
"format", QCoreApplication::translate(
"function_help",
"<h3>format() function</h3>\n"
510 "Format a string using supplied arguments. \n"
513 "<code>format('string', arg, [arg...n])</code><br>\n"
515 "<h4>Arguments</h4>\n"
516 "<code>string</code> - is string. String with Qt QString place holders. Use %1, %2, etc for placeholders. Placeholders can be repeated. \n"
518 "<code>arg [arg...n]</code> - any type. Any number of args. \n"
521 "<!-- Show example of function.-->\n"
522 "<code>format('This %1 a %2','is', 'test') → This is a test</code><br>") );
523 gFunctionHelpTexts.insert(
"scale_linear", QCoreApplication::translate(
"function_help",
"<h3>scale_linear() function</h3>\n"
524 "Transforms a given value from an input domain to an output range using linear interpolation. \n"
526 "<p><h4>Syntax</h4>\n"
527 " scale_linear(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>)</p>\n"
529 "<p><h4>Arguments</h4>\n"
530 "<!-- List args for functions here-->\n"
531 "<i> val</i> → is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
532 "<i> domain_min, domain_max</i> → specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
533 "<i> range_min, range_max</i> → specify the output range, the smallest and largest values which should be output by the function.<br>\n"
536 "<!-- Show example of function.-->\n"
537 " scale_linear(5,0,10,0,100) → 50<br>\n"
538 " 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"
539 " 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"
543 gFunctionHelpTexts.insert(
"symDifference", QCoreApplication::translate(
"function_help",
"<h3>symDifference function</h3>\n"
544 "Returns a geometry that represents the portions of a and b that do not intersect.\n"
547 "<pre>symDifference( geometry a, geometry b)</pre>\n"
549 "<h4>Arguments</h4>\n"
550 "geometry → geometry\n"
551 "geometry → geometry\n"
554 "<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"
556 gFunctionHelpTexts.insert(
"min", QCoreApplication::translate(
"function_help",
"<h3>min() function</h3>\n"
557 "Returns the smallest value in a set of values.\n"
560 " min(<i>value<i>[,<i>value</i>...])\n"
562 "<h4>Arguments</h4>\n"
563 "<!-- List args for functions here-->\n"
564 "<i> value</i> → a number.<br>\n"
567 "<!-- Show example of function.-->\n"
568 " min(20.5,10,6.2) → 6.2\n"
570 gFunctionHelpTexts.insert(
"Conversions", QCoreApplication::translate(
"function_help",
"<h3>Conversions Group</h3>\n"
571 "This group contains functions to convert on data type to another e.g string to integer, integer to string.\n"
573 gFunctionHelpTexts.insert(
"AND", QCoreApplication::translate(
"function_help",
"<h3>AND logical operator</h3>\n"
574 "Returns 1 when condition a and b are true.\n"
577 "<pre> condition a AND condition b </pre>\n"
579 "<h4>Arguments</h4>\n"
583 "<pre> 4 = 2+2 AND 1 = 1 → returns 1 </pre>\n"
584 "<pre> 4 = 2+2 AND 1 = 2 → returns 0 </pre>\n"
587 gFunctionHelpTexts.insert(
"lower", QCoreApplication::translate(
"function_help",
"<h3>lower() function</h3>\n"
588 "Converts a string to lower case letters.\n"
590 "<p><h4> Syntax</h4>\n"
591 " lower(<i>string</i>)</p>\n"
593 "<p><h4> Arguments</h4>\n"
594 "<i> string</i> → is string. The String to convert to lower case.</p>\n"
596 "<p><h4> Example</h4>\n"
597 " lower('HELLO World') → 'hello world'</p>\n"
599 gFunctionHelpTexts.insert(
"todatetime", QCoreApplication::translate(
"function_help",
"<h3>todatetime() function</h3>\n"
600 "Convert a string into Qt data time type.\n"
603 "<code>todatetime('string')</code><br>\n"
605 "<h4>Arguments</h4>\n"
606 "<code>string</code> - is string in Qt date time format.\n"
610 "<!-- Show example of function.-->\n"
611 "<code>todatetime('2012-05-04 12:50:00') → 2012-05-04T12:50:00</code><br>") );
612 gFunctionHelpTexts.insert(
"color_rgba", QCoreApplication::translate(
"function_help",
"\n"
613 "<h3>color_rgba() function</h3>\n"
614 "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components\n"
616 "<p><h4>Syntax</h4>\n"
617 " color_rgba(<i>red, green, blue, alpha</i>)</p>\n"
619 "<p><h4>Arguments</h4>\n"
620 "<!-- List args for functions here-->\n"
621 "<i> red</i> → the red component as an integer value from 0 to 255.<br>\n"
622 "<i> green</i> → the green component as an integer value from 0 to 255.<br>\n"
623 "<i> blue</i> → the blue component as an integer value from 0 to 255.<br>\n"
624 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
626 "<p><h4>Example</h4>\n"
627 "<!-- Show example of function.-->\n"
628 " color_rgba(255,127,0,200) → '255,127,0,200'</p>\n"
630 gFunctionHelpTexts.insert(
"color_cmyk", QCoreApplication::translate(
"function_help",
"\n"
631 "<h3>color_cmyk() function</h3>\n"
632 "Returns a string representation of a color based on its cyan, magenta, yellow and black components\n"
634 "<p><h4>Syntax</h4>\n"
635 " color_cmyk(<i>cyan, magenta, yellow, black</i>)</p>\n"
637 "<p><h4>Arguments</h4>\n"
638 "<!-- List args for functions here-->\n"
639 "<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
640 "<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
641 "<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
642 "<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
644 "<p><h4>Example</h4>\n"
645 "<!-- Show example of function.-->\n"
646 " color_cmyk(100,50,0,10) → '#0073e6'</p>\n"
648 gFunctionHelpTexts.insert(
"Conditions", QCoreApplication::translate(
"function_help",
"<h3>Conditions Group</h3>\n"
649 "This group contains functions that operate on condition.\n"
651 gFunctionHelpTexts.insert(
"floor", QCoreApplication::translate(
"function_help",
"<h3>floor() function</h3>\n"
652 "Rounds a number downwards.\n"
655 "<code>floor(value)</code><br>\n"
657 "<h4>Arguments</h4>\n"
658 "<code>value</code> - a number.\n"
662 "<!-- Show example of function.-->\n"
663 "<code>floor(4.9) → 4</code><br>\n"
664 "<code>floor(-4.9) → -5</code><br>\n"
666 gFunctionHelpTexts.insert(
"max", QCoreApplication::translate(
"function_help",
"<h3>max() function</h3>\n"
667 "Returns the largest value in a set of values.\n"
670 " max(<i>value<i>[,<i>value</i>...])\n"
672 "<h4>Arguments</h4>\n"
673 "<!-- List args for functions here-->\n"
674 "<i> value</i> → a number.<br>\n"
677 "<!-- Show example of function.-->\n"
678 " max(2,10.2,5.5) → 10.2\n"
680 gFunctionHelpTexts.insert(
"age", QCoreApplication::translate(
"function_help",
"<h3>age() function</h3>\n"
681 "Returns the difference between two dates.\n"
683 "The difference is returned as a <code>Interval</code> \n"
684 "and needs to be used with one of the following functions\n"
685 "in order to extract useful information:\n"
687 "<li><code>year</code>\n"
688 "<li><code>month</code>\n"
689 "<li><code>week</code>\n"
690 "<li><code>day</code>\n"
691 "<li><code>hour</code>\n"
692 "<li><code>minute</code>\n"
693 "<li><code>second</code>\n"
696 "<code>age(string,string)</code><br>\n"
697 "<code>age(datetime,datetime)</code><br>\n"
698 "<code>age(string,datetime)</code><br>\n"
699 "<code>age(datetime,string)</code><br>\n"
701 "<h4>Arguments</h4>\n"
702 "<code>string</code> - is string. A string in date format.\n"
704 "<code>datetime</code> - is date or datetime. A date or datetime type.\n"
707 "<!-- Show example of function.-->\n"
708 "<code>age('2012-05-12','2012-05-2') → Interval</code><br>\n"
709 "use <code>day</code> to extract number of days<br>\n"
710 "<code>day(age('2012-05-12','2012-05-2')) → 10</code><br>\n"
713 gFunctionHelpTexts.insert(
"color_hsv", QCoreApplication::translate(
"function_help",
"<h3>color_hsv() function</h3>\n"
714 "Returns a string representation of a color based on its hue, saturation, and value attributes\n"
716 "<p><h4>Syntax</h4>\n"
717 " color_hsv(<i>hue, saturation, value</i>)</p>\n"
719 "<p><h4>Arguments</h4>\n"
720 "<!-- List args for functions here-->\n"
721 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
722 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
723 "<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br>\n"
725 "<p><h4>Example</h4>\n"
726 "<!-- Show example of function.-->\n"
727 " color_hsv(40,100,100) → '#ffaa00'</p>\n"
729 gFunctionHelpTexts.insert(
"trim", QCoreApplication::translate(
"function_help",
"<h3>trim() function</h3>\n"
730 "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.\n"
732 "<p><h4>Syntax</h4>\n"
733 " trim(<i>string</i>)</p>\n"
735 "<p><h4>Arguments</h4>\n"
736 "<!-- List args for functions here-->\n"
737 "<i> string</i> → is string. The string to trim.</p>\n"
739 "<p><h4>Example</h4>\n"
740 "<!-- Show example of function.-->\n"
741 " trim(' hello world ') → 'hello world'</p>\n"
743 gFunctionHelpTexts.insert(
"tostring", QCoreApplication::translate(
"function_help",
"<h3>tostring() function</h3>\n"
744 "Converts a number to string.\n"
746 "<p><h4>Syntax</h4>\n"
747 " tostring(<i>number</i>)</p>\n"
749 "<p><h4>Arguments</h4>\n"
750 "<!-- List args for functions here-->\n"
751 "<i>number</i> → is integer or real. The number to convert to string.</p>\n"
753 "<p><h4>Example</h4>\n"
754 "<!-- Show example of function.-->\n"
755 " tostring(123) → '123'</p>\n"
757 gFunctionHelpTexts.insert(
"log", QCoreApplication::translate(
"function_help",
"<h3>log() function</h3>\n"
758 "Returns the value of the logarithm of the passed value and base.\n"
760 "This function takes two arguments.\n"
762 "<code>log(base, value)</code><br>\n"
764 "<h4>Arguments</h4>\n"
765 "<code>base</code> - any positive number.<br>\n"
766 "<code>value</code> - any positive number.\n"
770 "<!-- Show example of function.-->\n"
771 "<code>log(2, 32) → 5</code><br>\n"
772 "<code>log(0.5, 32) → -5</code><br>\n"
774 gFunctionHelpTexts.insert(
"title", QCoreApplication::translate(
"function_help",
"<h3>title() function</h3>\n"
775 "Converts all words of a string to title case (all words lower case with leading\n"
778 "<p><h4>Syntax</h4>\n"
779 " title(<i>string</i>)</p>\n"
781 "<p><h4>Arguments</h4>\n"
782 "<!-- List args for functions here-->\n"
783 "<i> string</i> → is string. The string to convert to title case.</p>\n"
785 "<p><h4>Example</h4>\n"
786 "<!-- Show example of function.-->\n"
787 " upper('hello WOrld') → 'Hello World'</p>\n"
789 gFunctionHelpTexts.insert(
"coalesce", QCoreApplication::translate(
"function_help",
"<h3>coalesce() function</h3>\n"
790 "Returns the first non-NULL value from the expression list.\n"
792 "This function can take any number of arguments.\n"
794 "<code>coalesce(expression1, expression2 ...)</code><br>\n"
796 "<h4>Arguments</h4>\n"
797 "<code>expression</code> - any valid expression or value, irregardless of type.\n"
801 "<!-- Show example of function.-->\n"
802 "<code>coalesce(NULL, 2) → 2</code><br>\n"
803 "<code>coalesce(NULL, 2, 3) → 2</code><br>\n"
804 "<code>coalesce(7, NULL, 3*2) → 7</code><br><br>\n"
805 "<code>coalesce(\"fieldA\", \"fallbackField\", 'ERROR') → value of fieldA if it is non-NULL\n"
806 " else the value of \"fallbackField\" or the string 'ERROR' if both are NULL</code><br>\n"
809 gFunctionHelpTexts.insert(
"intersects", QCoreApplication::translate(
"function_help",
"<h3>intersects function</h3>\n"
810 "Returns 1 if the geometries spatially intersect (share any portion of space) and 0 if they don't.\n"
813 "<pre>intersects( a, b )</pre>\n"
815 "<h4>Arguments</h4>\n"
816 "a → geometry\n"
817 "b → geometry\n"
820 "<pre> intersects( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
821 "<pre> intersects( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'POINT(5 5)' )) → returns 0</pre>\n"
823 gFunctionHelpTexts.insert(
"color_hsl", QCoreApplication::translate(
"function_help",
"<h3>color_hsl() function</h3>\n"
824 "Returns a string representation of a color based on its hue, saturation, and lightness attributes\n"
826 "<p><h4>Syntax</h4>\n"
827 " color_hsl(<i>hue, saturation, lightness</i>)</p>\n"
829 "<p><h4>Arguments</h4>\n"
830 "<!-- List args for functions here-->\n"
831 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
832 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
833 "<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
835 "<p><h4>Example</h4>\n"
836 "<!-- Show example of function.-->\n"
837 " color_hsl(100,50,70) → '#a6d98c'</p>\n"
839 gFunctionHelpTexts.insert(
"$numpages", QCoreApplication::translate(
"function_help",
"<h3>$numpages function</h3>\n"
840 "Returns the total number of pages in the composition.\n"
843 "<pre>$numpages</pre>\n"
845 "<h4>Arguments</h4>\n"
849 "<pre>$numpages → 42</pre>\n"
852 gFunctionHelpTexts.insert(
"$length", QCoreApplication::translate(
"function_help",
"<h3>$length function</h3>\n"
853 "Returns the length of the current feature.\n"
856 "<pre>$length</pre>\n"
858 "<h4>Arguments</h4>\n"
862 "<pre>$length → 42.4711</pre>\n"
864 gFunctionHelpTexts.insert(
"todate", QCoreApplication::translate(
"function_help",
"<h3>todate() function</h3>\n"
865 "Convert a string into Qt data type.\n"
868 "<code>todate('string')</code><br>\n"
870 "<h4>Arguments</h4>\n"
871 "<code>string</code> - is string in Qt date format.\n"
875 "<!-- Show example of function.-->\n"
876 "<code>todate('2012-05-04') → 2012-05-04</code><br>") );
877 gFunctionHelpTexts.insert(
"upper", QCoreApplication::translate(
"function_help",
"<h3>upper() function</h3>\n"
878 "Converts a string to upper case letters.\n"
880 "<p><h4>Syntax</h4>\n"
881 " upper(<i>string</i>)</p>\n"
883 "<p><h4>Arguments</h4>\n"
884 "<!-- List args for functions here-->\n"
885 "<i> string</i> → is string. The String to convert to upper case.</p>\n"
887 "<p><h4>Example</h4>\n"
888 "<!-- Show example of function.-->\n"
889 " upper('hello WOrld') → 'HELLO WORLD'</p>\n"
891 gFunctionHelpTexts.insert(
"overlaps", QCoreApplication::translate(
"function_help",
"<h3>overlaps function</h3>\n"
892 "Returns 1 if the geometries share space, are of the same dimension, but are not completely contained by each other.\n"
895 "<pre>overlaps( a, b )</pre>\n"
897 "<h4>Arguments</h4>\n"
898 "a → geometry\n"
899 "b → geometry\n"
902 "<pre> overlaps( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 5 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 1</pre>\n"
903 "<pre> overlaps( geomFromWKT( 'LINESTRING(0 0 , 1 1)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) → returns 0</pre>\n"
905 gFunctionHelpTexts.insert(
"toint", QCoreApplication::translate(
"function_help",
"<h3>toint() function</h3>\n"
906 "Converts a string to integer number. Nothing changed if a value cannot be converted to integer (e.g '123asd' is invalid).\n"
908 "<p><h4>Syntax</h4>\n"
909 " toint(<i>string</i>)</p>\n"
911 "<p><h4>Arguments</h4>\n"
912 "<!-- List args for functions here-->\n"
913 "<i> string</i> → is string. The String to convert to integer number.</p>\n"
915 "<p><h4>Example</h4>\n"
916 "<!-- Show example of function.-->\n"
917 " toint('123') → 123</p>\n"
919 gFunctionHelpTexts.insert(
"CASE", QCoreApplication::translate(
"function_help",
"<h3>CASE expression</h3>\n"
920 "A conditional expression that can be used to evaluate multiple expressions and\n"
926 " WHEN <i>condition</i> THEN <i>result</i>\n"
928 " [ ELSE <i>result</i> ]\n"
931 "[ ] marks optional components\n"
933 "<h4>Arguments</h4>\n"
934 "<!-- List args for functions here-->\n"
935 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
936 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
937 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
940 "<!-- Show example of function.-->\n"
943 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
947 gFunctionHelpTexts.insert(
"year", QCoreApplication::translate(
"function_help",
"<h3>year() function</h3>\n"
948 "Extract the year part from a date, or the number of years\n"
949 "from a <code>Interval</code>\n"
952 "<code>year(date)</code><br>\n"
953 "<code>year(Interval)</code><br>\n"
955 "<h4>Arguments</h4>\n"
956 "<code>date</code> - is date or datetime. The date to extract the year from.\n"
958 "<code>Interval</code> - is Interval. The Interval to return the number of years from.\n"
961 "<!-- Show example of function.-->\n"
962 "<code>year('2012-05-12') → 2012</code><br>\n"
963 "<code>year(tointerval('3 Years')) → 3</code><br>\n"
964 "<code>year(age('2012-01-01','2010-01-01')) → 1.9986..</code><br>\n"
967 gFunctionHelpTexts.insert(
"Conditionals", QCoreApplication::translate(
"function_help",
"<h3>Conditionals Group</h3>\n"
968 "This group contains functions to handle conditional checks in expressions.\n"
970 gFunctionHelpTexts.insert(
"log10", QCoreApplication::translate(
"function_help",
"<h3>log10() function</h3>\n"
971 "Returns the value of the base 10 logarithm of the passed expression.\n"
973 "This function takes one argument.\n"
975 "<code>log10(value)</code><br>\n"
977 "<h4>Arguments</h4>\n"
978 "<code>value</code> - any positive number.\n"
982 "<!-- Show example of function.-->\n"
983 "<code>log10(1) → 0</code><br>\n"
984 "<code>log10(100) → 2</code><br>\n"
986 gFunctionHelpTexts.insert(
"ln", QCoreApplication::translate(
"function_help",
"<h3>ln() function</h3>\n"
987 "Returns the value of the natural logarithm of the passed expression.\n"
989 "This function takes one argument.\n"
991 "<code>ln(value)</code><br>\n"
993 "<h4>Arguments</h4>\n"
994 "<code>value</code> - any positive number.\n"
998 "<!-- Show example of function.-->\n"
999 "<code>ln(1) → 0</code><br>\n"
1000 "<code>ln(2.7182818284590452354) → 1</code><br>\n"
1002 gFunctionHelpTexts.insert(
"$pi", QCoreApplication::translate(
"function_help",
"<h3>$pi constant</h3>\n"
1003 "Returns pi as value for calculations\n"
1008 "<h4>Arguments</h4>\n"
1011 "<h4>Example</h4>\n"
1012 "<pre>$pi → 3.14159265358979</pre>\n"
1014 gFunctionHelpTexts.insert(
"atan", QCoreApplication::translate(
"function_help",
"<h3>atan() function</h3>\n"
1015 "Returns arcustanget of a value in radians.\n"
1018 "<p><h4>Syntax</h4>\n"
1019 " atan(<i>real</i>)</p>\n"
1021 "<p><h4>Arguments</h4>\n"
1022 "<i>real</i> → tan of an angle.</p>\n"
1024 "<p><h4>Example</h4>\n"
1025 " atan(0.5) → 0.463647609000806</p>\n"
1027 gFunctionHelpTexts.insert(
"Geometry", QCoreApplication::translate(
"function_help",
"<h3>Geometry Group</h3>\n"
1028 "This group contains functions that operate on geometry objects e.g length, area.\n"
1030 gFunctionHelpTexts.insert(
"$x", QCoreApplication::translate(
"function_help",
"<h3>$x function</h3>\n"
1031 "Returns the x coordinate of the current feature.\n"
1036 "<h4>Arguments</h4>\n"
1039 "<h4>Example</h4>\n"
1040 "<pre>$x → 42</pre>\n"
1043 gFunctionHelpTexts.insert(
"LIKE", QCoreApplication::translate(
"function_help",
"<h3>LIKE expression</h3>\n"
1044 "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also.\n"
1047 "<pre>string/number LIKE pattern</pre>\n"
1049 "<h4>Arguments</h4>\n"
1052 "<h4>Example</h4>\n"
1053 "<pre> 'A' LIKE 'A' → returns 1 </pre>\n"
1054 "<pre> 'A' LIKE 'a' → returns 0 </pre>\n"
1055 "<pre> 'A' LIKE 'B' → returns 0 </pre>\n"
1057 gFunctionHelpTexts.insert(
"sqrt", QCoreApplication::translate(
"function_help",
"<h3>sqrt() function</h3>\n"
1058 "Returns square root of a value\n"
1061 "<p><h4>Syntax</h4>\n"
1062 " sqrt(<i>real</i>)</p>\n"
1064 "<p><h4>Arguments</h4>\n"
1065 "<i>real</i> → number.</p>\n"
1067 "<p><h4>Example</h4>\n"
1068 " sqrt(9) → 3</p>\n"
1070 gFunctionHelpTexts.insert(
"tan", QCoreApplication::translate(
"function_help",
"<h3>tan() function</h3>\n"
1071 "Returns tangent of an angle.\n"
1074 "<p><h4>Syntax</h4>\n"
1075 " tan(<i>real</i>)</p>\n"
1077 "<p><h4>Arguments</h4>\n"
1078 "<i>real</i> → angle in radians.</p>\n"
1080 "<p><h4>Example</h4>\n"
1081 " tan(1.0) → 1.5574077246549</p>\n"
1083 gFunctionHelpTexts.insert(
"format_number", QCoreApplication::translate(
"function_help",
"<h3>format_number() function</h3>\n"
1084 "Returns a number formatted with the locale separator for thousands. \n"
1085 "Also truncates the number to the number of supplied places. \n"
1087 "<code>format_number(number,places)</code><br>\n"
1089 "<h4>Arguments</h4>\n"
1090 "<code>number</code> - is number. The number to be formatted.\n"
1092 "<code>places</code> - is int. The number of decimal places to truncate the string\n"
1095 "<h4>Example</h4>\n"
1096 "<!-- Show example of function.-->\n"
1097 "<code>format_number(10000000.332,2) → 10,000,000.33</code>\n"
1100 gFunctionHelpTexts.insert(
"round", QCoreApplication::translate(
"function_help",
"<h3>round() function</h3>\n"
1101 "Rounds a number to number of decimal places.\n"
1103 "This function can take one or two arguments depending on what is needed.\n"
1105 "<code>round(decimal,places)</code><br>\n"
1106 "<code>round(decimal)</code><br>\n"
1108 "<h4>Arguments</h4>\n"
1109 "<code>decimal</code> - is decimal. The decimal number to be rounded.\n"
1111 "<code>places</code> - is int. The number of places to round decimal too. Can be negative.\n"
1113 "<h4>Example</h4>\n"
1114 "<!-- Show example of function.-->\n"
1115 "<code>round(1234.567, 2 ) → 1234.57</code><br>\n"
1116 "use <code>round(decimal)</code> to round to the nearest integer<br>\n"
1117 "<code>round(1234.567) → 1235</code><br>\n"
1121 gFunctionHelpTexts.insert(
"regexp_replace", QCoreApplication::translate(
"function_help",
"<h3>regexp_replace() function</h3>\n"
1122 "Returns a string with the supplied regular expression replaced.\n"
1124 "<p><h4>Syntax</h4>\n"
1125 " regexp_replace(<i>string,regex,after</i>)</p>\n"
1127 "<p><h4>Arguments</h4>\n"
1128 "<!-- List args for functions here-->\n"
1129 "<i> string</i> → is string. The start string.<br>\n"
1130 "<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"
1131 "<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"
1133 "<p><h4>Example</h4>\n"
1134 "<!-- Show example of function.-->\n"
1135 " regexp_replace('QGIS SHOULD ROCK','\\sSHOULD\\s',' DOES ') → 'QGIS DOES ROCK'</p>\n"
1137 gFunctionHelpTexts.insert(
"Record", QCoreApplication::translate(
"function_help",
"<h3>Record Group</h3>\n"
1138 "This group contains functions that operate on record identifiers.\n"
1140 gFunctionHelpTexts.insert(
"contains", QCoreApplication::translate(
"function_help",
"<h3>contains function</h3>\n"
1141 " 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"
1144 "<pre>contains( geometry a , geometry a)</pre>\n"
1146 "<h4>Arguments</h4>\n"
1147 "geometry → geometry\n"
1148 "geometry → geometry\n"
1150 "<h4>Example</h4>\n"
1151 "<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'POINT( 0.5 0.5 )' )) → returns 1</pre>\n"
1152 "<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"
1154 gFunctionHelpTexts.insert(
"$id", QCoreApplication::translate(
"function_help",
"<h3>$id function</h3>\n"
1155 "Returns the feature id of the current row.\n"
1160 "<h4>Arguments</h4>\n"
1163 "<h4>Example</h4>\n"
1164 "<pre>$id → 42</pre>\n"
1167 gFunctionHelpTexts.insert(
"format_date", QCoreApplication::translate(
"function_help",
"<h3>format_date() function</h3>\n"
1168 "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"
1171 "<code>format_date('string', 'format_string')</code><br>\n"
1173 "<h4>Arguments</h4>\n"
1174 "<code>string</code> - is string. Date/Time/DateTime string.\n"
1176 "<code>format_string</code> - is string. String template used to format the string.\n"
1181 " <th>Expression</th>\n"
1183 " <th>Output</th>\n"
1187 " <tr valign=\"top\">\n"
1190 " <td>the day as number without a leading zero (1 to 31)</td>\n"
1193 " <tr valign=\"top\">\n"
1196 " <td>the day as number with a leading zero (01 to 31)</td>\n"
1199 " <tr valign=\"top\">\n"
1202 " <td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses <a href=\n"
1203 " \"qdate.html#shortDayName\">QDate::shortDayName</a>().</td>\n"
1206 " <tr valign=\"top\">\n"
1209 " <td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses <a href=\n"
1210 " \"qdate.html#longDayName\">QDate::longDayName</a>().</td>\n"
1213 " <tr valign=\"top\">\n"
1216 " <td>the month as number without a leading zero (1-12)</td>\n"
1219 " <tr valign=\"top\">\n"
1222 " <td>the month as number with a leading zero (01-12)</td>\n"
1225 " <tr valign=\"top\">\n"
1228 " <td>the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses <a href=\n"
1229 " \"qdate.html#shortMonthName\">QDate::shortMonthName</a>().</td>\n"
1232 " <tr valign=\"top\">\n"
1235 " <td>the long localized month name (e.g. 'January' to 'December'). Uses <a href=\n"
1236 " \"qdate.html#longMonthName\">QDate::longMonthName</a>().</td>\n"
1239 " <tr valign=\"top\">\n"
1242 " <td>the year as two digit number (00-99)</td>\n"
1245 " <tr valign=\"top\">\n"
1248 " <td>the year as four digit number</td>\n"
1252 " <p>These expressions may be used for the time part of the format string:</p>\n"
1257 " <th>Expression</th>\n"
1259 " <th>Output</th>\n"
1263 " <tr valign=\"top\">\n"
1266 " <td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td>\n"
1269 " <tr valign=\"top\">\n"
1272 " <td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td>\n"
1275 " <tr valign=\"top\">\n"
1278 " <td>the hour without a leading zero (0 to 23, even with AM/PM display)</td>\n"
1281 " <tr valign=\"top\">\n"
1284 " <td>the hour with a leading zero (00 to 23, even with AM/PM display)</td>\n"
1287 " <tr valign=\"top\">\n"
1290 " <td>the minute without a leading zero (0 to 59)</td>\n"
1293 " <tr valign=\"top\">\n"
1296 " <td>the minute with a leading zero (00 to 59)</td>\n"
1299 " <tr valign=\"top\">\n"
1302 " <td>the second without a leading zero (0 to 59)</td>\n"
1305 " <tr valign=\"top\">\n"
1308 " <td>the second with a leading zero (00 to 59)</td>\n"
1311 " <tr valign=\"top\">\n"
1314 " <td>the milliseconds without leading zeroes (0 to 999)</td>\n"
1317 " <tr valign=\"top\">\n"
1320 " <td>the milliseconds with leading zeroes (000 to 999)</td>\n"
1323 " <tr valign=\"top\">\n"
1324 " <td>AP or A</td>\n"
1326 " <td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td>\n"
1329 " <tr valign=\"top\">\n"
1330 " <td>ap or a</td>\n"
1332 " <td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td>\n"
1338 "<h4>Example</h4>\n"
1339 "<!-- Show example of function.-->\n"
1340 "<code>format_date('2012-05-15','dd.mm.yyyy') → 15.05.2012</code><br>\n"
1342 gFunctionHelpTexts.insert(
"exp", QCoreApplication::translate(
"function_help",
"<h3>exp() function</h3>\n"
1343 "Returns exponential of an value.\n"
1346 "<p><h4>Syntax</h4>\n"
1347 " exp(<i>real</i>)</p>\n"
1349 "<p><h4>Arguments</h4>\n"
1350 "<i>real</i> → number.</p>\n"
1352 "<p><h4>Example</h4>\n"
1353 " exp(1.0) → 2.71828182845905</p>\n"
1355 gFunctionHelpTexts.insert(
"$now", QCoreApplication::translate(
"function_help",
"<h3>$now function</h3>\n"
1356 "Returns the current date and time\n"
1361 "<h4>Arguments</h4>\n"
1364 "<h4>Example</h4>\n"
1365 "<pre>$now → 2012-07-22T13:24:57</pre>\n"
1368 gFunctionHelpTexts.insert(
"$rownum", QCoreApplication::translate(
"function_help",
"<h3>$rownum function</h3>\n"
1369 "Returns the number of the current row.\n"
1372 "<pre>$rownum</pre>\n"
1374 "<h4>Arguments</h4>\n"
1377 "<h4>Example</h4>\n"
1378 "<pre>$rownum → 4711</pre>\n"
1381 gFunctionHelpTexts.insert(
"replace", QCoreApplication::translate(
"function_help",
"<h3>replace() function</h3>\n"
1382 "Returns a string with the the supplied string replaced.\n"
1384 "<p><h4>Syntax</h4>\n"
1385 " replace(<i>string,before,after</i>)</p>\n"
1387 "<p><h4>Arguments</h4>\n"
1388 "<!-- List args for functions here-->\n"
1389 "<i> string</i> → is string. The start string.<br>\n"
1390 "<i> before</i> → is string. The string to replace.<br>\n"
1391 "<i> after</i> → is string. The string that will replace <i>before</i><br></p>\n"
1393 "<p><h4>Example</h4>\n"
1394 "<!-- Show example of function.-->\n"
1395 " replace('QGIS SHOULD ROCK','SHOULD','DOES') → 'QGIS DOES ROCK'</p>\n"
1397 gFunctionHelpTexts.insert(
"lpad", QCoreApplication::translate(
"function_help",
"<h3>lpad() function</h3>\n"
1398 "Returns a string with supplied width padded\n"
1399 "using the fill character.\n"
1402 "<code>lpad(string, length, fill)</code><br>\n"
1404 "<h4>Arguments</h4>\n"
1405 "<code>string</code> - is string. The string.\n"
1407 "<code>length</code> - is int. The length of the new string.\n"
1409 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1411 "<h4>Example</h4>\n"
1412 "<!-- Show example of function.-->\n"
1413 "<code>lpad('Hello', 10, 'x') → 'Helloxxxxx'</code><br>\n"
1415 gFunctionHelpTexts.insert(
"$map", QCoreApplication::translate(
"function_help",
"<h3>$map function</h3>\n"
1416 "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"
1417 "drawn within the main QGIS window.\n"
1422 "<h4>Arguments</h4>\n"
1425 "<h4>Example</h4>\n"
1426 "<!-- Show example of function.-->\n"
1427 "<pre>$map → \"overview_map\" (within a composer item)<br />\n"
1428 "$map → \"canvas\" (within the main QGIS main canvas)</pre>\n"
1432 gFunctionHelpTexts.insert(
"NOT", QCoreApplication::translate(
"function_help",
"<h3>NOT</h3>\n"
1433 "Returns 1 if a is not the same as b.\n"
1436 "<pre> a NOT b </pre>\n"
1438 "<h4>Arguments</h4>\n"
1441 "<h4>Example</h4>\n"
1442 "<pre> 'a' IS NOT 'b' → returns 1 </pre>\n"
1443 "<pre> 'a' IS NOT 'a' → returns 0 </pre>\n"
1444 "<pre> 4 IS NOT 2+2 → returns 0 </pre>\n"
1447 gFunctionHelpTexts.insert(
"ceil", QCoreApplication::translate(
"function_help",
"<h3>ceil() function</h3>\n"
1448 "Rounds a number upwards.\n"
1451 "<code>ceil(value)</code><br>\n"
1453 "<h4>Arguments</h4>\n"
1454 "<code>value</code> - a number.\n"
1457 "<h4>Example</h4>\n"
1458 "<!-- Show example of function.-->\n"
1459 "<code>ceil(4.9) → 5</code><br>\n"
1460 "<code>ceil(-4.9) → -4</code><br>\n"
1462 gFunctionHelpTexts.insert(
"$area", QCoreApplication::translate(
"function_help",
"<h3>$area function</h3>\n"
1463 "Returns the area size of the current feature.\n"
1466 "<pre>$area</pre>\n"
1468 "<h4>Arguments</h4>\n"
1471 "<h4>Example</h4>\n"
1472 "<pre>$area → 42</pre>\n"
1475 gFunctionHelpTexts.insert(
"sin", QCoreApplication::translate(
"function_help",
"<h3>sin() function</h3>\n"
1476 "Returns sinus of an angle.\n"
1479 "<p><h4>Syntax</h4>\n"
1480 " sin(<i>real</i>)</p>\n"
1482 "<p><h4>Arguments</h4>\n"
1483 "<i>real</i> → angle in radians.</p>\n"
1485 "<p><h4>Example</h4>\n"
1486 " sin(1.571) → 0.999999682931835</p>\n"
1488 gFunctionHelpTexts.insert(
"week", QCoreApplication::translate(
"function_help",
"<h3>week() function</h3>\n"
1489 "Extract the week number from a date, or the number of weeks\n"
1490 "from a <code>Interval</code>\n"
1493 "<code>week(date)</code><br>\n"
1494 "<code>week(Interval)</code><br>\n"
1496 "<h4>Arguments</h4>\n"
1497 "<code>date</code> - is date or datetime. The date to extract the week from.\n"
1499 "<code>Interval</code> - is Interval. The Interval to return the number of weeks from.\n"
1501 "<h4>Example</h4>\n"
1502 "<!-- Show example of function.-->\n"
1503 "<code>week('2012-05-12') → 19</code><br>\n"
1504 "<code>week(tointerval('3 weeks')) → 3</code><br>\n"
1505 "<code>week(age('2012-01-01','2010-01-01')) → 104.285...</code><br>\n"
1508 gFunctionHelpTexts.insert(
"rpad", QCoreApplication::translate(
"function_help",
"<h3>rpad() function</h3>\n"
1509 "Returns a string with supplied width padded\n"
1510 "using the fill character.\n"
1513 "<code>rpad(string, width, fill)</code><br>\n"
1515 "<h4>Arguments</h4>\n"
1516 "<code>string</code> - is string. The string.\n"
1518 "<code>width</code> - is int. The length of the new string.\n"
1520 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1522 "<h4>Example</h4>\n"
1523 "<!-- Show example of function.-->\n"
1524 "<code>rpad('Hello', 10, 'x') → 'xxxxxHello'</code><br>\n"
1527 gFunctionHelpTexts.insert(
"day", QCoreApplication::translate(
"function_help",
"<h3>day() function</h3>\n"
1528 "Extract the day from a date, or the number of days\n"
1529 "from a <code>Interval</code>\n"
1532 "<code>day(date)</code><br>\n"
1533 "<code>day(Interval)</code><br>\n"
1535 "<h4>Arguments</h4>\n"
1536 "<code>date</code> - is date or datetime. The date to extract the day from.\n"
1538 "<code>Interval</code> - is Interval. The Interval to return the number of days from.\n"
1540 "<h4>Example</h4>\n"
1541 "<!-- Show example of function.-->\n"
1542 "<code>day('2012-05-12') → 12</code><br>\n"
1543 "<code>day(tointerval('3 days')) → 3</code><br>\n"
1544 "<code>day(age('2012-01-01','2010-01-01')) → 730</code><br>\n"
1547 gFunctionHelpTexts.insert(
"geomFromWKT", QCoreApplication::translate(
"function_help",
"<h3>geomFromWKT function</h3>\n"
1548 "Returns a geometry created from a Well-Known Text (WKT) representation.\n"
1551 "<pre>geomFromWKT(text)</pre>\n"
1553 "<h4>Arguments</h4>\n"
1554 "text → Well-Known Text (WKT) representation of a geometry\n"
1556 "<h4>Example</h4>\n"
1557 "<pre> geomFromWKT( 'POINT(4 5)' ) → returns a geometry</pre>\n"
1560 gFunctionHelpTexts.insert(
"combine", QCoreApplication::translate(
"function_help",
"<h3>combine function</h3>\n"
1561 "Returns the combination of geometry a and geometry b.\n"
1564 "<pre>combine( geometry a , geometry b)</pre>\n"
1566 "<h4>Arguments</h4>\n"
1567 "geometry → geometry\n"
1568 "geometry → geometry\n"
1570 "<h4>Example</h4>\n"
1571 "<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"
1572 "<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"
1574 gFunctionHelpTexts.insert(
"Color", QCoreApplication::translate(
"function_help",
"\n"
1575 "<h3>Color Group</h3>\n"
1576 "This group contains functions for manipulating colors\n"
1578 gFunctionHelpTexts.insert(
"buffer", QCoreApplication::translate(
"function_help",
"<h3>buffer function</h3>\n"
1579 "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"
1582 "<pre>buffer(a, b)</pre>\n"
1584 "<h4>Arguments</h4>\n"
1585 "a → geometry\n"
1586 "b → distance for the buffer\n"
1588 "<h4>Example</h4>\n"
1589 "<pre> buffer($geometry, 10.5 ) → returns a polygon</pre>\n"
1592 gFunctionHelpTexts.insert(
"acos", QCoreApplication::translate(
"function_help",
"<h3>acos() function</h3>\n"
1593 "Returns arcuscosinus of a value in radians.\n"
1596 "<p><h4>Syntax</h4>\n"
1597 " acos(<i>real</i>)</p>\n"
1599 "<p><h4>Arguments</h4>\n"
1600 "<i>real</i> → cos of an angle.</p>\n"
1602 "<p><h4>Example</h4>\n"
1603 " acos(0.5) → 1.0471975511966</p>\n"
1605 gFunctionHelpTexts.insert(
"Math", QCoreApplication::translate(
"function_help",
"<h3>Math Group</h3>\n"
1606 "This group contains math functions e.g square root, sin and cos\n"
1608 gFunctionHelpTexts.insert(
"$feature", QCoreApplication::translate(
"function_help",
"<h3>$feature function</h3>\n"
1609 "In atlas generation, returns the current feature number that is iterated over on the coverage layer.\n"
1612 "<pre>$feature</pre>\n"
1614 "<h4>Arguments</h4>\n"
1617 "<h4>Example</h4>\n"
1618 "<pre>$feature → 2</pre>\n"
1621 gFunctionHelpTexts.insert(
"atan2", QCoreApplication::translate(
"function_help",
"<h3>atan2() function</h3>\n"
1622 "Returns arcustangens of y/x using the signs of the two \n"
1623 "arguments to determine the quadrant of the result\n"
1627 "<p><h4>Syntax</h4>\n"
1628 " atan2(<i>real</i>, <i>real</i>)</p>\n"
1630 "<p><h4>Arguments</h4>\n"
1631 "<i>real</i> → y coordinate difference<br>\n"
1632 "<i>real</i> → x coordinate difference</p>\n"
1634 "<p><h4>Example</h4>\n"
1635 " atan2(1.0, 1.732) → 0.523611477769969</p>\n"
1637 gFunctionHelpTexts.insert(
"regexp_match", QCoreApplication::translate(
"function_help",
"<h3>regexp_match() function</h3>\n"
1638 "Returns true if any part of a string matches the supplied regular expression.\n"
1640 "<p><h4>Syntax</h4>\n"
1641 " regexp_match(<i>string,regex</i>)</p>\n"
1643 "<p><h4>Arguments</h4>\n"
1644 "<!-- List args for functions here-->\n"
1645 "<i> string</i> → is string. The string to test against the regular expression.<br>\n"
1646 "<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"
1648 "<p><h4>Example</h4>\n"
1649 "<!-- Show example of function.-->\n"
1650 " regexp_match('QGIS ROCKS','\\sROCKS') → 1</p>\n"
1652 gFunctionHelpTexts.insert(
"hour", QCoreApplication::translate(
"function_help",
"<h3>hour() function</h3>\n"
1653 "Extract the hour from a datetime or time, or the number of hours\n"
1654 "from a <code>Interval</code>\n"
1657 "<code>hour(datetime)</code><br>\n"
1658 "<code>hour(Interval)</code><br>\n"
1660 "<h4>Arguments</h4>\n"
1661 "<code>date</code> - is datetime or time. The date to extract the hour from.\n"
1663 "<code>Interval</code> - is Interval. The Interval to return the number of hours from.\n"
1665 "<h4>Example</h4>\n"
1666 "<!-- Show example of function.-->\n"
1667 "<code>hour('2012-07-22T13:24:57') → 13</code><br>\n"
1668 "<code>hour(tointerval('3 hours')) → 3</code><br>\n"
1669 "<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) → 3</code><br>\n"
1670 "<code>hour(age('2012-01-01','2010-01-01')) → 17520</code><br>\n"
1673 gFunctionHelpTexts.insert(
"Date and Time", QCoreApplication::translate(
"function_help",
"<h3>Date and Time Group</h3>\n"
1674 "This group contains functions for handling date and time data.\n"
1676 gFunctionHelpTexts.insert(
"ILIKE", QCoreApplication::translate(
"function_help",
"<h3>ILIKE expression</h3>\n"
1677 "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"
1680 "<pre>string/number ILIKE pattern</pre>\n"
1682 "<h4>Arguments</h4>\n"
1685 "<h4>Example</h4>\n"
1686 "<pre> 'A' ILIKE 'A' → returns 1 </pre>\n"
1687 "<pre> 'A' ILIKE 'a' → returns 1 </pre>\n"
1688 "<pre> 'A' ILIKE 'B' → returns 0 </pre>\n"
1690 gFunctionHelpTexts.insert(
"$page", QCoreApplication::translate(
"function_help",
"<h3>$page function</h3>\n"
1691 "Returns the current page number within a composition.\n"
1694 "<pre>$page</pre>\n"
1696 "<h4>Arguments</h4>\n"
1699 "<h4>Example</h4>\n"
1700 "<pre>$page → 2</pre>\n"
1703 gFunctionHelpTexts.insert(
"tointerval", QCoreApplication::translate(
"function_help",
"<h3>tointerval() function</h3>\n"
1704 "Converts a string to a interval type. Can be used to take days, hours, month, etc off a date. \n"
1707 "<code>tointerval('string')</code><br>\n"
1709 "<h4>Arguments</h4>\n"
1710 "<code>string</code> - is string. Format {n} days {n} hours {n} months\n"
1713 "<h4>Example</h4>\n"
1714 "<!-- Show example of function.-->\n"
1715 "<code>todatetime('2012-05-05 12:00:00') - tointerval('1 day 2 hours') → 2012-05-04T10:00:00</code><br>") );
1716 gFunctionHelpTexts.insert(
"convexHull", QCoreApplication::translate(
"function_help",
"<h3>convexHull function</h3>\n"
1717 "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.\n"
1720 "<pre>convexHull( a, b )</pre>\n"
1722 "<h4>Arguments</h4>\n"
1723 "a → geometry\n"
1724 "a → geometry\n"
1726 "<h4>Example</h4>\n"
1727 "<pre> geomToWKT( convexHull( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 4 10)' )) ) → returns POLYGON((3 3,4 10,4 4,3 3)) </pre>\n"
1729 gFunctionHelpTexts.insert(
"asin", QCoreApplication::translate(
"function_help",
"<h3>asin() function</h3>\n"
1730 "Returns arcussinus of a value in radians.\n"
1733 "<p><h4>Syntax</h4>\n"
1734 " asin(<i>real</i>)</p>\n"
1736 "<p><h4>Arguments</h4>\n"
1737 "<i>real</i> → sin of an angle.</p>\n"
1739 "<p><h4>Example</h4>\n"
1740 " asin(1.0) → 1.5707963267949</p>\n"
1742 gFunctionHelpTexts.insert(
"$geometry", QCoreApplication::translate(
"function_help",
"<h3>$geometry function</h3>\n"
1743 "Returns the geometry of the current feature. Can be used for processing with other functions.\n"
1746 "<pre>$geometry</pre>\n"
1748 "<h4>Arguments</h4>\n"
1751 "<h4>Example</h4>\n"
1752 "<pre> geomToWKT( $geometry ) → POINT(6 50)</pre>\n"
1755 gFunctionHelpTexts.insert(
"Operators", QCoreApplication::translate(
"function_help",
"<h3>Operators Group</h3>\n"
1756 "This group contains operators e.g + - * \n"
1758 gFunctionHelpTexts.insert(
"difference", QCoreApplication::translate(
"function_help",
"<h3>difference function</h3>\n"
1759 "Returns a geometry that represents that part of geometry a that does not intersect with geometry b.\n"
1762 "<pre>difference( a, b )</pre>\n"
1764 "<h4>Arguments</h4>\n"
1765 "geometry → geometry\n"
1766 "geometry → geometry\n"
1768 "<h4>Example</h4>\n"
1769 "<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"
1771 gFunctionHelpTexts.insert(
"IS", QCoreApplication::translate(
"function_help",
"<h3>IS expression</h3>\n"
1772 "Returns 1 if a is the same as b.\n"
1775 "<pre>a is b</pre>\n"
1777 "<h4>Arguments</h4>\n"
1780 "<h4>Example</h4>\n"
1781 "<pre> 'A' IS 'A' → returns 1 </pre>\n"
1782 "<pre> 'A' IS 'a' → returns 0 </pre>\n"
1783 "<pre> 4 IS 4 → returns 1 </pre>\n"
1784 "<pre> 4 IS 2+2 → returns 1 </pre>\n"
1785 "<pre> 4 IS 2 → returns 0 </pre>\n"
1786 "<pre> 4 IS 2 → returns 0 </pre>\n"
1787 "<pre> $geometry IS NULL → returns 0, if your geometry is not NULL</pre>\n"
1790 gFunctionHelpTexts.insert(
"color_hsla", QCoreApplication::translate(
"function_help",
"<h3>color_hsla() function</h3>\n"
1791 "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes\n"
1793 "<p><h4>Syntax</h4>\n"
1794 " color_hsla(<i>hue, saturation, lightness, alpha</i>)</p>\n"
1796 "<p><h4>Arguments</h4>\n"
1797 "<!-- List args for functions here-->\n"
1798 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
1799 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1800 "<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
1801 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1803 "<p><h4>Example</h4>\n"
1804 "<!-- Show example of function.-->\n"
1805 " color_hsla(100,50,70,200) → '166,217,140,200'</p>\n"
1807 gFunctionHelpTexts.insert(
"Fields and Values", QCoreApplication::translate(
"function_help",
"<h3>Fields and Values</h3>\n"
1808 "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\n"
1810 "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"
1812 "<p><h4>Note:</h4>\n"
1813 "Loading field values from WFS layers isn't supported, before the layer is\n"
1814 "actually inserted, ie. when building queries.\n"
1817 gFunctionHelpTexts.insert(
"$perimeter", QCoreApplication::translate(
"function_help",
"<h3>$perimeter function</h3>\n"
1818 "Returns the perimeter length of the current feature.\n"
1821 "<pre>$perimeter</pre>\n"
1823 "<h4>Arguments</h4>\n"
1826 "<h4>Example</h4>\n"
1827 "<pre>$perimeter → 42</pre>\n"
1830 gFunctionHelpTexts.insert(
"totime", QCoreApplication::translate(
"function_help",
"<h3>totime() function</h3>\n"
1831 "Convert a string into Qt time type.\n"
1834 "<code>totime('string')</code><br>\n"
1836 "<h4>Arguments</h4>\n"
1837 "<code>string</code> - is string in Qt time format.\n"
1840 "<h4>Example</h4>\n"
1841 "<!-- Show example of function.-->\n"
1842 "<code>totime('12:30:01') → 12:30:01</code><br>") );
1843 gFunctionHelpTexts.insert(
"String", QCoreApplication::translate(
"function_help",
"<h3>String Group</h3>\n"
1844 "This group contains functions that operate on strings e.g replace, convert to upper case.\n"
1846 gFunctionHelpTexts.insert(
"CASE ELSE", QCoreApplication::translate(
"function_help",
"<h3>CASE expression</h3>\n"
1847 "A conditional expression that can be used to evaluate multiple expressions and\n"
1848 "return a result.\n"
1853 " WHEN <i>condition</i> THEN <i>result</i>\n"
1855 " [ ELSE <i>result</i> ]\n"
1858 "[ ] marks optional components\n"
1860 "<h4>Arguments</h4>\n"
1861 "<!-- List args for functions here-->\n"
1862 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
1863 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
1864 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
1866 "<h4>Example</h4>\n"
1867 "<!-- Show example of function.-->\n"
1870 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
1871 " ELSE <i>\"column\"</i>\n"
1875 gFunctionHelpTexts.insert(
"toreal", QCoreApplication::translate(
"function_help",
"<h3>toreal() function</h3>\n"
1876 "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"
1878 "<p><h4>Syntax</h4>\n"
1879 " toreal(<i>string</i>)</p>\n"
1881 "<p><h4>Arguments</h4>\n"
1882 "<!-- List args for functions here-->\n"
1883 "<i> string</i> → is string. The String to convert to real number.</p>\n"
1885 "<p><h4>Example</h4>\n"
1886 "<!-- Show example of function.-->\n"
1887 " toreal('123.45') → 123.45</p>\n"
1889 gFunctionHelpTexts.insert(
"regexp_substr", QCoreApplication::translate(
"function_help",
"<h3>regexp_substr() function</h3>\n"
1890 "Returns the portion of a string which matches a supplied regular expression.\n"
1892 "<p><h4>Syntax</h4>\n"
1893 " regexp_substr(<i>string,regex</i>)</p>\n"
1895 "<p><h4>Arguments</h4>\n"
1896 "<!-- List args for functions here-->\n"
1897 "<i> string</i> → is string. The input string.<br>\n"
1898 "<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"
1900 "<p><h4>Example</h4>\n"
1901 "<!-- Show example of function.-->\n"
1902 " regexp_substr('abc123','(\\d+)') → '123'</p>\n"
1904 gFunctionHelpTexts.insert(
"geomFromGML", QCoreApplication::translate(
"function_help",
"<h3>geomFromGML function</h3>\n"
1905 "Returns a geometry from a GML representation of geometry\n"
1908 "<pre>geomFromGML(text)</pre>\n"
1910 "<h4>Arguments</h4>\n"
1911 "text → GML representation of a geometry\n"
1913 "<h4>Example</h4>\n"
1914 "<pre> geomFromGML( '<gml:LineString srsName=\"EPSG:4326\"><gml:coordinates>4,4 5,5 6,6</gml:coordinates></gml:LineString>') → returns a geometry</pre>\n"
1917 gFunctionHelpTexts.insert(
"$scale", QCoreApplication::translate(
"function_help",
"<h3>$scale function</h3>\n"
1918 "Returns the current scale of the map canvas.\n"
1920 "Note: This function is only available in some contexts and will be 0 otherwise. \n"
1922 "<code>$scale</code><br>\n"
1924 "<h4>Example</h4>\n"
1925 "<!-- Show example of function.-->\n"
1926 "<code>$scale → 10000</code><br>\n"
1930 gFunctionHelpTexts.insert(
"OR", QCoreApplication::translate(
"function_help",
"<h3>OR logical operator</h3>\n"
1931 "Returns 1 when condition a or b is true.\n"
1934 "<pre> condition a OR condition b </pre>\n"
1936 "<h4>Arguments</h4>\n"
1939 "<h4>Example</h4>\n"
1940 "<pre> 4 = 2+2 OR 1 = 1 → returns 1 </pre>\n"
1941 "<pre> 4 = 2+2 OR 1 = 2 → returns 1 </pre>\n"
1942 "<pre> 4 = 2 OR 1 = 2 → returns 0 </pre>\n"
1944 gFunctionHelpTexts.insert(
"left", QCoreApplication::translate(
"function_help",
"<h3>left() function</h3>\n"
1945 "Returns a substring that contains the <i>n</i> leftmost characters of the string.\n"
1948 "<code>left(string, length)</code><br>\n"
1950 "<h4>Arguments</h4>\n"
1951 "<code>string</code> - is string. The string.\n"
1953 "<code>length</code> - is int. The number of characters from the left to return.\n"
1955 "<h4>Example</h4>\n"
1956 "<!-- Show example of function.-->\n"
1957 "<code>left('Hello World',5) → 'Hello'</code><br>\n"
1960 gFunctionHelpTexts.insert(
"color_cmyka", QCoreApplication::translate(
"function_help",
"\n"
1961 "<h3>color_cmyka() function</h3>\n"
1962 "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components\n"
1964 "<p><h4>Syntax</h4>\n"
1965 " color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p>\n"
1967 "<p><h4>Arguments</h4>\n"
1968 "<!-- List args for functions here-->\n"
1969 "<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
1970 "<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
1971 "<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
1972 "<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
1973 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1975 "<p><h4>Example</h4>\n"
1976 "<!-- Show example of function.-->\n"
1977 " color_cmyka(100,50,0,10,200) → '0,115,230,200'</p>\n"