2 #include <QCoreApplication>
11 gFunctionHelpTexts.insert(
"CASE", QCoreApplication::translate(
"function_help",
"<h3>CASE expression</h3>\n"
12 "A conditional expression that can be used to evaluate multiple expressions and\n"
18 " WHEN <i>condition</i> THEN <i>result</i>\n"
20 " [ ELSE <i>result</i> ]\n"
23 "[ ] marks optional components\n"
25 "<h4>Arguments</h4>\n"
26 "<!-- List args for functions here-->\n"
27 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
28 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
29 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
32 "<!-- Show example of function.-->\n"
35 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
39 gFunctionHelpTexts.insert(
"Date and Time", QCoreApplication::translate(
"function_help",
"<h3>Date and Time Group</h3>\n"
40 "This group contains functions for handling date and time data.\n"
42 gFunctionHelpTexts.insert(
"color_cmyk", QCoreApplication::translate(
"function_help",
"\n"
43 "<h3>color_cmyk() function</h3>\n"
44 "Returns a string representation of a color based on its cyan, magenta, yellow and black components\n"
46 "<p><h4>Syntax</h4>\n"
47 " color_cmyk(<i>cyan, magenta, yellow, black</i>)</p>\n"
49 "<p><h4>Arguments</h4>\n"
50 "<!-- List args for functions here-->\n"
51 "<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
52 "<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
53 "<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
54 "<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
56 "<p><h4>Example</h4>\n"
57 "<!-- Show example of function.-->\n"
58 " color_cmyk(100,50,0,10) → '#0073e6'</p>\n"
60 gFunctionHelpTexts.insert(
"trim", QCoreApplication::translate(
"function_help",
"<h3>trim() function</h3>\n"
61 "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.\n"
63 "<p><h4>Syntax</h4>\n"
64 " trim(<i>string</i>)</p>\n"
66 "<p><h4>Arguments</h4>\n"
67 "<!-- List args for functions here-->\n"
68 "<i> string</i> → is string. The string to trim.</p>\n"
70 "<p><h4>Example</h4>\n"
71 "<!-- Show example of function.-->\n"
72 " trim(' hello world ') → 'hello world'</p>\n"
74 gFunctionHelpTexts.insert(
"color_hsv", QCoreApplication::translate(
"function_help",
"<h3>color_hsv() function</h3>\n"
75 "Returns a string representation of a color based on its hue, saturation, and value attributes\n"
77 "<p><h4>Syntax</h4>\n"
78 " color_hsv(<i>hue, saturation, value</i>)</p>\n"
80 "<p><h4>Arguments</h4>\n"
81 "<!-- List args for functions here-->\n"
82 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
83 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
84 "<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br>\n"
86 "<p><h4>Example</h4>\n"
87 "<!-- Show example of function.-->\n"
88 " color_hsv(40,100,100) → '#ffaa00'</p>\n"
90 gFunctionHelpTexts.insert(
"rand", QCoreApplication::translate(
"function_help",
"<h3>rand() function</h3>\n"
91 "Returns a random integer within the range specified by the minimum and \n"
92 "maximum argument (inclusive).\n"
94 "This function takes two arguments.\n"
96 "<code>rand(min, max)</code><br>\n"
98 "<h4>Arguments</h4>\n"
99 "<code>min</code> - an integer representing the smallest possible random number desired.<br>\n"
100 "<code>max</code> - an integer representing the largest possible random number desired.\n"
104 "<!-- Show example of function.-->\n"
105 "<code>rand(1, 10) → 8</code><br>\n"
107 gFunctionHelpTexts.insert(
"format_number", QCoreApplication::translate(
"function_help",
"<h3>format_number() function</h3>\n"
108 "Returns a number formatted with the locale separator for thousands. \n"
109 "Also truncates the number to the number of supplied places. \n"
111 "<code>format_number(number,places)</code><br>\n"
113 "<h4>Arguments</h4>\n"
114 "<code>number</code> - is number. The number to be formatted.\n"
116 "<code>places</code> - is int. The number of decimal places to truncate the string\n"
120 "<!-- Show example of function.-->\n"
121 "<code>format_number(10000000.332,2) → 10,000,000.33</code>\n"
124 gFunctionHelpTexts.insert(
"regexp_substr", QCoreApplication::translate(
"function_help",
"<h3>regexp_substr() function</h3>\n"
125 "Returns the portion of a string which matches a supplied regular expression.\n"
127 "<p><h4>Syntax</h4>\n"
128 " regexp_substr(<i>string,regex</i>)</p>\n"
130 "<p><h4>Arguments</h4>\n"
131 "<!-- List args for functions here-->\n"
132 "<i> string</i> → is string. The input string.<br>\n"
133 "<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"
135 "<p><h4>Example</h4>\n"
136 "<!-- Show example of function.-->\n"
137 " regexp_substr('abc123','(\\d+)') → '123'</p>\n"
139 gFunctionHelpTexts.insert(
"totime", QCoreApplication::translate(
"function_help",
"<h3>totime() function</h3>\n"
140 "Convert a string into Qt time type.\n"
143 "<code>totime('string')</code><br>\n"
145 "<h4>Arguments</h4>\n"
146 "<code>string</code> - is string in Qt time format.\n"
150 "<!-- Show example of function.-->\n"
151 "<code>totime('12:30:01') → 12:30:01</code><br>") );
152 gFunctionHelpTexts.insert(
"atan2", QCoreApplication::translate(
"function_help",
"<h3>atan2() function</h3>\n"
153 "Returns arcustangens of y/x using the signs of the two \n"
154 "arguments to determine the quadrant of the result\n"
158 "<p><h4>Syntax</h4>\n"
159 " atan2(<i>real</i>, <i>real</i>)</p>\n"
161 "<p><h4>Arguments</h4>\n"
162 "<i>real</i> → y coordinate difference<br>\n"
163 "<i>real</i> → x coordinate difference</p>\n"
165 "<p><h4>Example</h4>\n"
166 " atan2(1.0, 1.732) → 0.523611477769969</p>\n"
168 gFunctionHelpTexts.insert(
"age", QCoreApplication::translate(
"function_help",
"<h3>age() function</h3>\n"
169 "Returns the difference between two dates.\n"
171 "The difference is returned as a <code>Interval</code> \n"
172 "and needs to be used with one of the following functions\n"
173 "in order to extract useful information:\n"
175 "<li><code>year</code>\n"
176 "<li><code>month</code>\n"
177 "<li><code>week</code>\n"
178 "<li><code>day</code>\n"
179 "<li><code>hour</code>\n"
180 "<li><code>minute</code>\n"
181 "<li><code>second</code>\n"
184 "<code>age(string,string)</code><br>\n"
185 "<code>age(datetime,datetime)</code><br>\n"
186 "<code>age(string,datetime)</code><br>\n"
187 "<code>age(datetime,string)</code><br>\n"
189 "<h4>Arguments</h4>\n"
190 "<code>string</code> - is string. A string in date format.\n"
192 "<code>datetime</code> - is date or datetime. A date or datetime type.\n"
195 "<!-- Show example of function.-->\n"
196 "<code>age('2012-05-12','2012-05-2') → Interval</code><br>\n"
197 "use <code>day</code> to extract number of days<br>\n"
198 "<code>day(age('2012-05-12','2012-05-2')) → 10</code><br>\n"
201 gFunctionHelpTexts.insert(
"toreal", QCoreApplication::translate(
"function_help",
"<h3>toreal() function</h3>\n"
202 "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"
204 "<p><h4>Syntax</h4>\n"
205 " toreal(<i>string</i>)</p>\n"
207 "<p><h4>Arguments</h4>\n"
208 "<!-- List args for functions here-->\n"
209 "<i> string</i> → is string. The String to convert to real number.</p>\n"
211 "<p><h4>Example</h4>\n"
212 "<!-- Show example of function.-->\n"
213 " toreal('123.45') → 123.45</p>\n"
215 gFunctionHelpTexts.insert(
"scale_exp", QCoreApplication::translate(
"function_help",
"<h3>scale_exp() function</h3>\n"
216 "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"
217 "of the specified output range. \n"
219 "<p><h4>Syntax</h4>\n"
220 " 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"
222 "<p><h4>Arguments</h4>\n"
223 "<!-- List args for functions here-->\n"
224 "<i> val</i> → is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
225 "<i> domain_min, domain_max</i> → specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
226 "<i> range_min, range_max</i> → specify the output range, the smallest and largest values which should be output by the function.<br>\n"
227 "<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"
228 "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"
231 "<!-- Show example of function.-->\n"
232 "<b>Easing in, using an exponent of 2:</b><br>\n"
233 " scale_exp(5,0,10,0,100,2) → 25<br>\n"
234 " scale_exp(7.5,0,10,0,100,2) → 56.25<br>\n"
235 " scale_exp(9.5,0,10,0,100,2) → 90.25<br> \n"
237 "<b>Easing out, using an exponent of 0.5:</b><br> \n"
238 " scale_exp(3,0,10,0,100,0.5) → 54.772<br>\n"
239 " scale_exp(6,0,10,0,100,0.5) → 77.459<br>\n"
240 " scale_exp(9,0,10,0,100,0.5) → 94.868<br> \n"
244 gFunctionHelpTexts.insert(
"yat", QCoreApplication::translate(
"function_help",
"<h3>yat() function</h3>\n"
245 "Retrieves a y coordinate of the current feature\n"
248 "<code>yat(i)</code>\n"
250 "<h4>Arguments</h4>\n"
251 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
254 "<pre>yat(1) → 5</pre>\n"
256 gFunctionHelpTexts.insert(
"minute", QCoreApplication::translate(
"function_help",
"<h3>minute() function</h3>\n"
257 "Extract the minute from a datetime or time, or the number of minutes\n"
258 "from a <code>Interval</code>\n"
261 "<code>minute(datetime)</code><br>\n"
262 "<code>minute(Interval)</code><br>\n"
264 "<h4>Arguments</h4>\n"
265 "<code>date</code> - is datetime or time. The date to extract the minute from.\n"
267 "<code>Interval</code> - is Interval. The Interval to return the number of minutes from.\n"
270 "<!-- Show example of function.-->\n"
271 "<code>minute('2012-07-22T13:24:57') → 24</code><br>\n"
272 "<code>minute(tointerval('3 minutes')) → 3</code><br>\n"
273 "<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) → 20</code><br>\n"
274 "<code>minute(age('2012-01-01','2010-01-01')) → 1051200</code><br>\n"
277 gFunctionHelpTexts.insert(
"Conversions", QCoreApplication::translate(
"function_help",
"<h3>Conversions Group</h3>\n"
278 "This group contains functions to convert on data type to another e.g string to integer, integer to string.\n"
280 gFunctionHelpTexts.insert(
"min", QCoreApplication::translate(
"function_help",
"<h3>min() function</h3>\n"
281 "Returns the smallest value in a set of values.\n"
284 " min(<i>value<i>[,<i>value</i>...])\n"
286 "<h4>Arguments</h4>\n"
287 "<!-- List args for functions here-->\n"
288 "<i> value</i> → a number.<br>\n"
291 "<!-- Show example of function.-->\n"
292 " min(20.5,10,6.2) → 6.2\n"
294 gFunctionHelpTexts.insert(
"Math", QCoreApplication::translate(
"function_help",
"<h3>Math Group</h3>\n"
295 "This group contains math functions e.g square root, sin and cos\n"
297 gFunctionHelpTexts.insert(
"$length", QCoreApplication::translate(
"function_help",
"<h3>$length function</h3>\n"
298 "Returns the length of the current feature.\n"
301 "<pre>$length</pre>\n"
303 "<h4>Arguments</h4>\n"
307 "<pre>$length → 42.4711</pre>\n"
309 gFunctionHelpTexts.insert(
"exp", QCoreApplication::translate(
"function_help",
"<h3>exp() function</h3>\n"
310 "Returns exponential of an value.\n"
313 "<p><h4>Syntax</h4>\n"
314 " exp(<i>real</i>)</p>\n"
316 "<p><h4>Arguments</h4>\n"
317 "<i>real</i> → number.</p>\n"
319 "<p><h4>Example</h4>\n"
320 " exp(1.0) → 2.71828182845905</p>\n"
322 gFunctionHelpTexts.insert(
"color_cmyka", QCoreApplication::translate(
"function_help",
"\n"
323 "<h3>color_cmyka() function</h3>\n"
324 "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components\n"
326 "<p><h4>Syntax</h4>\n"
327 " color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p>\n"
329 "<p><h4>Arguments</h4>\n"
330 "<!-- List args for functions here-->\n"
331 "<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
332 "<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
333 "<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
334 "<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
335 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
337 "<p><h4>Example</h4>\n"
338 "<!-- Show example of function.-->\n"
339 " color_cmyka(100,50,0,10,200) → '0,115,230,200'</p>\n"
341 gFunctionHelpTexts.insert(
"$page", QCoreApplication::translate(
"function_help",
"<h3>$page function</h3>\n"
342 "Returns the current page number within a composition.\n"
347 "<h4>Arguments</h4>\n"
351 "<pre>$page → 2</pre>\n"
354 gFunctionHelpTexts.insert(
"clamp", QCoreApplication::translate(
"function_help",
"<h3>clamp() function</h3>\n"
355 "Restricts an input value to a specified range.\n"
357 "<p><h4>Syntax</h4>\n"
358 " clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>\n"
360 "<p><h4>Arguments</h4>\n"
361 "<!-- List args for functions here-->\n"
362 "<i> minimum</i> → The smallest value <i>input</i> is allowed to take.<br>\n"
363 "<i> input</i> → a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>\n"
364 "<i> maximum</i> → The largest value <i>input</i> is allowed to take.<br>\n"
367 "<!-- Show example of function.-->\n"
368 " clamp(1,5,10) → 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>\n"
369 " clamp(1,0,10) → 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>\n"
370 " clamp(1,11,10) → 10 (<i>input</i> is greater than maximum value of 10, so function returns 11)<br>\n"
374 gFunctionHelpTexts.insert(
"cos", QCoreApplication::translate(
"function_help",
"<h3>cos() function</h3>\n"
375 "Returns cosinus of an angle.\n"
378 "<p><h4>Syntax</h4>\n"
379 " cos(<i>real</i>)</p>\n"
381 "<p><h4>Arguments</h4>\n"
382 "<i>real</i> → angle in radians.</p>\n"
384 "<p><h4>Example</h4>\n"
385 " cos(1.571) → 0.000796326710733263</p>\n"
387 gFunctionHelpTexts.insert(
"round", QCoreApplication::translate(
"function_help",
"<h3>round() function</h3>\n"
388 "Rounds a number to number of decimal places.\n"
390 "This function can take one or two arguments depending on what is needed.\n"
392 "<code>round(decimal,places)</code><br>\n"
393 "<code>round(decimal)</code><br>\n"
395 "<h4>Arguments</h4>\n"
396 "<code>decimal</code> - is decimal. The decimal number to be rounded.\n"
398 "<code>places</code> - is int. The number of places to round decimal too. Can be negative.\n"
401 "<!-- Show example of function.-->\n"
402 "<code>round(1234.567, 2 ) → 1234.57</code><br>\n"
403 "use <code>round(decimal)</code> to round to the nearest integer<br>\n"
404 "<code>round(1234.567) → 1235</code><br>\n"
408 gFunctionHelpTexts.insert(
"title", QCoreApplication::translate(
"function_help",
"<h3>title() function</h3>\n"
409 "Converts all words of a string to title case (all words lower case with leading\n"
412 "<p><h4>Syntax</h4>\n"
413 " title(<i>string</i>)</p>\n"
415 "<p><h4>Arguments</h4>\n"
416 "<!-- List args for functions here-->\n"
417 "<i> string</i> → is string. The string to convert to title case.</p>\n"
419 "<p><h4>Example</h4>\n"
420 "<!-- Show example of function.-->\n"
421 " upper('hello WOrld') → 'Hello World'</p>\n"
423 gFunctionHelpTexts.insert(
"month", QCoreApplication::translate(
"function_help",
"<h3>month() function</h3>\n"
424 "Extract the month part from a date, or the number of months\n"
425 "from a <code>Interval</code>\n"
428 "<code>month(date)</code><br>\n"
429 "<code>month(Interval)</code><br>\n"
431 "<h4>Arguments</h4>\n"
432 "<code>date</code> - is date or datetime. The date to extract the month from.\n"
434 "<code>Interval</code> - is Interval. The Interval to return the number of months from.\n"
437 "<!-- Show example of function.-->\n"
438 "<code>month('2012-05-12') → 05</code><br>\n"
439 "<code>month(tointerval('3 months')) → 3</code><br>\n"
440 "<code>month(age('2012-01-01','2010-01-01')) → 4.033...</code><br>\n"
443 gFunctionHelpTexts.insert(
"Record", QCoreApplication::translate(
"function_help",
"<h3>Record Group</h3>\n"
444 "This group contains functions that operate on record identifiers.\n"
446 gFunctionHelpTexts.insert(
"floor", QCoreApplication::translate(
"function_help",
"<h3>floor() function</h3>\n"
447 "Rounds a number downwards.\n"
450 "<code>floor(value)</code><br>\n"
452 "<h4>Arguments</h4>\n"
453 "<code>value</code> - a number.\n"
457 "<!-- Show example of function.-->\n"
458 "<code>floor(4.9) → 4</code><br>\n"
459 "<code>floor(-4.9) → -5</code><br>\n"
461 gFunctionHelpTexts.insert(
"color_rgba", QCoreApplication::translate(
"function_help",
"\n"
462 "<h3>color_rgba() function</h3>\n"
463 "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components\n"
465 "<p><h4>Syntax</h4>\n"
466 " color_rgba(<i>red, green, blue, alpha</i>)</p>\n"
468 "<p><h4>Arguments</h4>\n"
469 "<!-- List args for functions here-->\n"
470 "<i> red</i> → the red component as an integer value from 0 to 255.<br>\n"
471 "<i> green</i> → the green component as an integer value from 0 to 255.<br>\n"
472 "<i> blue</i> → the blue component as an integer value from 0 to 255.<br>\n"
473 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
475 "<p><h4>Example</h4>\n"
476 "<!-- Show example of function.-->\n"
477 " color_rgba(255,127,0,200) → '255,127,0,200'</p>\n"
479 gFunctionHelpTexts.insert(
"right", QCoreApplication::translate(
"function_help",
"<h3>right() function</h3>\n"
480 "Returns a substring that contains the <i>n</i> rightmost characters of the string.\n"
483 "<code>right(string, pos)</code><br>\n"
485 "<h4>Arguments</h4>\n"
486 "<code>string</code> - is string. The string.\n"
488 "<code>length</code> - is int. The number of characters from the right to return.\n"
491 "<!-- Show example of function.-->\n"
492 "<code>right('Hello World',5) → 'World'</code><br>\n"
495 gFunctionHelpTexts.insert(
"$numpages", QCoreApplication::translate(
"function_help",
"<h3>$numpages function</h3>\n"
496 "Returns the total number of pages in the composition.\n"
499 "<pre>$numpages</pre>\n"
501 "<h4>Arguments</h4>\n"
505 "<pre>$numpages → 42</pre>\n"
508 gFunctionHelpTexts.insert(
"regexp_replace", QCoreApplication::translate(
"function_help",
"<h3>regexp_replace() function</h3>\n"
509 "Returns a string with the supplied regular expression replaced.\n"
511 "<p><h4>Syntax</h4>\n"
512 " regexp_replace(<i>string,regex,after</i>)</p>\n"
514 "<p><h4>Arguments</h4>\n"
515 "<!-- List args for functions here-->\n"
516 "<i> string</i> → is string. The start string.<br>\n"
517 "<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"
518 "<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"
520 "<p><h4>Example</h4>\n"
521 "<!-- Show example of function.-->\n"
522 " regexp_replace('QGIS SHOULD ROCK','\\sSHOULD\\s',' DOES ') → 'QGIS DOES ROCK'</p>\n"
524 gFunctionHelpTexts.insert(
"coalesce", QCoreApplication::translate(
"function_help",
"<h3>coalesce() function</h3>\n"
525 "Returns the first non-NULL value from the expression list.\n"
527 "This function can take any number of arguments.\n"
529 "<code>coalesce(expression1, expression2 ...)</code><br>\n"
531 "<h4>Arguments</h4>\n"
532 "<code>expression</code> - any valid expression or value, irregardless of type.\n"
536 "<!-- Show example of function.-->\n"
537 "<code>coalesce(NULL, 2) → 2</code><br>\n"
538 "<code>coalesce(NULL, 2, 3) → 2</code><br>\n"
539 "<code>coalesce(7, NULL, 3*2) → 7</code><br><br>\n"
540 "<code>coalesce(\"fieldA\", \"fallbackField\", 'ERROR') → value of fieldA if it is non-NULL\n"
541 " else the value of \"fallbackField\" or the string 'ERROR' if both are NULL</code><br>\n"
544 gFunctionHelpTexts.insert(
"hour", QCoreApplication::translate(
"function_help",
"<h3>hour() function</h3>\n"
545 "Extract the hour from a datetime or time, or the number of hours\n"
546 "from a <code>Interval</code>\n"
549 "<code>hour(datetime)</code><br>\n"
550 "<code>hour(Interval)</code><br>\n"
552 "<h4>Arguments</h4>\n"
553 "<code>date</code> - is datetime or time. The date to extract the hour from.\n"
555 "<code>Interval</code> - is Interval. The Interval to return the number of hours from.\n"
558 "<!-- Show example of function.-->\n"
559 "<code>hour('2012-07-22T13:24:57') → 13</code><br>\n"
560 "<code>hour(tointerval('3 hours')) → 3</code><br>\n"
561 "<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) → 3</code><br>\n"
562 "<code>hour(age('2012-01-01','2010-01-01')) → 17520</code><br>\n"
565 gFunctionHelpTexts.insert(
"tointerval", QCoreApplication::translate(
"function_help",
"<h3>tointerval() function</h3>\n"
566 "Converts a string to a interval type. Can be used to take days, hours, month, etc off a date. \n"
569 "<code>tointerval('string')</code><br>\n"
571 "<h4>Arguments</h4>\n"
572 "<code>string</code> - is string. Format {n} days {n} hours {n} months\n"
576 "<!-- Show example of function.-->\n"
577 "<code>todatetime('2012-05-05 12:00:00') - tointerval('1 day 2 hours') → 2012-05-04T10:00:00</code><br>") );
578 gFunctionHelpTexts.insert(
"$pi", QCoreApplication::translate(
"function_help",
"<h3>$pi constant</h3>\n"
579 "Returns pi as value for calculations\n"
584 "<h4>Arguments</h4>\n"
588 "<pre>$pi → 3.14159265358979</pre>\n"
590 gFunctionHelpTexts.insert(
"week", QCoreApplication::translate(
"function_help",
"<h3>week() function</h3>\n"
591 "Extract the week number from a date, or the number of weeks\n"
592 "from a <code>Interval</code>\n"
595 "<code>week(date)</code><br>\n"
596 "<code>week(Interval)</code><br>\n"
598 "<h4>Arguments</h4>\n"
599 "<code>date</code> - is date or datetime. The date to extract the week from.\n"
601 "<code>Interval</code> - is Interval. The Interval to return the number of weeks from.\n"
604 "<!-- Show example of function.-->\n"
605 "<code>week('2012-05-12') → 19</code><br>\n"
606 "<code>week(tointerval('3 weeks')) → 3</code><br>\n"
607 "<code>week(age('2012-01-01','2010-01-01')) → 104.285...</code><br>\n"
610 gFunctionHelpTexts.insert(
"day", QCoreApplication::translate(
"function_help",
"<h3>day() function</h3>\n"
611 "Extract the day from a date, or the number of days\n"
612 "from a <code>Interval</code>\n"
615 "<code>day(date)</code><br>\n"
616 "<code>day(Interval)</code><br>\n"
618 "<h4>Arguments</h4>\n"
619 "<code>date</code> - is date or datetime. The date to extract the day from.\n"
621 "<code>Interval</code> - is Interval. The Interval to return the number of days from.\n"
624 "<!-- Show example of function.-->\n"
625 "<code>day('2012-05-12') → 12</code><br>\n"
626 "<code>day(tointerval('3 days')) → 3</code><br>\n"
627 "<code>day(age('2012-01-01','2010-01-01')) → 730</code><br>\n"
630 gFunctionHelpTexts.insert(
"max", QCoreApplication::translate(
"function_help",
"<h3>max() function</h3>\n"
631 "Returns the largest value in a set of values.\n"
634 " max(<i>value<i>[,<i>value</i>...])\n"
636 "<h4>Arguments</h4>\n"
637 "<!-- List args for functions here-->\n"
638 "<i> value</i> → a number.<br>\n"
641 "<!-- Show example of function.-->\n"
642 " max(2,10.2,5.5) → 10.2\n"
644 gFunctionHelpTexts.insert(
"strpos", QCoreApplication::translate(
"function_help",
"<h3>strpos() function</h3>\n"
645 "Return the index of a regular expression in a string.\n"
648 " strpos(<i>haystack</i>, <i>needle</i>)\n"
650 "Returns -1 if the expression isn't found.\n"
652 "<p><h4>Arguments</h4>\n"
653 "<!-- List args for functions here-->\n"
654 "<i> haystack</i> → is string. The string that is to be searched.<br>\n"
655 "<i> needle</i> → is number. The regular expression to look for.<br>\n"
658 "<!-- Show example of function.-->\n"
659 " strpos('HELLO WORLD','WORLD') → 6<br>\n"
660 " strpos('HELLO WORLD','GOODBYE') → -1<br>\n"
662 gFunctionHelpTexts.insert(
"Operators", QCoreApplication::translate(
"function_help",
"<h3>Operators Group</h3>\n"
663 "This group contains operators e.g + - * \n"
665 gFunctionHelpTexts.insert(
"tostring", QCoreApplication::translate(
"function_help",
"<h3>tostring() function</h3>\n"
666 "Converts a number to string.\n"
668 "<p><h4>Syntax</h4>\n"
669 " tostring(<i>number</i>)</p>\n"
671 "<p><h4>Arguments</h4>\n"
672 "<!-- List args for functions here-->\n"
673 "<i>number</i> → is integer or real. The number to convert to string.</p>\n"
675 "<p><h4>Example</h4>\n"
676 "<!-- Show example of function.-->\n"
677 " tostring(123) → '123'</p>\n"
679 gFunctionHelpTexts.insert(
"year", QCoreApplication::translate(
"function_help",
"<h3>year() function</h3>\n"
680 "Extract the year part from a date, or the number of years\n"
681 "from a <code>Interval</code>\n"
684 "<code>year(date)</code><br>\n"
685 "<code>year(Interval)</code><br>\n"
687 "<h4>Arguments</h4>\n"
688 "<code>date</code> - is date or datetime. The date to extract the year from.\n"
690 "<code>Interval</code> - is Interval. The Interval to return the number of years from.\n"
693 "<!-- Show example of function.-->\n"
694 "<code>year('2012-05-12') → 2012</code><br>\n"
695 "<code>year(tointerval('3 Years')) → 3</code><br>\n"
696 "<code>year(age('2012-01-01','2010-01-01')) → 1.9986..</code><br>\n"
699 gFunctionHelpTexts.insert(
"randf", QCoreApplication::translate(
"function_help",
"<h3>randf() function</h3>\n"
700 "Returns a random float within the range specified by the minimum and \n"
701 "maximum argument (inclusive).\n"
703 "This function takes two arguments.\n"
705 "<code>randf(min, max)</code><br>\n"
707 "<h4>Arguments</h4>\n"
708 "<code>min</code> - a float representing the smallest possible random number desired.<br>\n"
709 "<code>max</code> - a float representing the largest possible random number desired.\n"
713 "<!-- Show example of function.-->\n"
714 "<code>randf(1, 10) → 4.59258286403147</code><br>\n"
716 gFunctionHelpTexts.insert(
"$now", QCoreApplication::translate(
"function_help",
"<h3>$now function</h3>\n"
717 "Returns the current date and time\n"
722 "<h4>Arguments</h4>\n"
726 "<pre>$now → 2012-07-22T13:24:57</pre>\n"
729 gFunctionHelpTexts.insert(
"length", QCoreApplication::translate(
"function_help",
"<h3>length() function</h3>\n"
730 "Returns the length of a string.\n"
732 "<p><h4>Syntax</h4>\n"
733 " length(<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 count the length of.</p>\n"
739 "<p><h4>Example</h4>\n"
740 "<!-- Show example of function.-->\n"
741 " length('HELLO') → 5</p>\n"
743 gFunctionHelpTexts.insert(
"scale_linear", QCoreApplication::translate(
"function_help",
"<h3>scale_linear() function</h3>\n"
744 "Transforms a given value from an input domain to an output range using linear interpolation. \n"
746 "<p><h4>Syntax</h4>\n"
747 " scale_linear(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>)</p>\n"
749 "<p><h4>Arguments</h4>\n"
750 "<!-- List args for functions here-->\n"
751 "<i> val</i> → is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
752 "<i> domain_min, domain_max</i> → specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
753 "<i> range_min, range_max</i> → specify the output range, the smallest and largest values which should be output by the function.<br>\n"
756 "<!-- Show example of function.-->\n"
757 " scale_linear(5,0,10,0,100) → 50<br>\n"
758 " 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"
759 " 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"
763 gFunctionHelpTexts.insert(
"lower", QCoreApplication::translate(
"function_help",
"<h3>lower() function</h3>\n"
764 "Converts a string to lower case letters.\n"
766 "<p><h4> Syntax</h4>\n"
767 " lower(<i>string</i>)</p>\n"
769 "<p><h4> Arguments</h4>\n"
770 "<i> string</i> → is string. The String to convert to lower case.</p>\n"
772 "<p><h4> Example</h4>\n"
773 " lower('HELLO World') → 'hello world'</p>\n"
775 gFunctionHelpTexts.insert(
"ln", QCoreApplication::translate(
"function_help",
"<h3>ln() function</h3>\n"
776 "Returns the value of the natural logarithm of the passed expression.\n"
778 "This function takes one argument.\n"
780 "<code>ln(value)</code><br>\n"
782 "<h4>Arguments</h4>\n"
783 "<code>value</code> - any positive number.\n"
787 "<!-- Show example of function.-->\n"
788 "<code>ln(1) → 0</code><br>\n"
789 "<code>ln(2.7182818284590452354) → 1</code><br>\n"
791 gFunctionHelpTexts.insert(
"Fields and Values", QCoreApplication::translate(
"function_help",
"<h3>Fields and Values</h3>\n"
792 "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\n"
794 "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"
796 "<p><h4>Note:</h4>\n"
797 "Loading field values from WFS layers isn't supported, before the layer is\n"
798 "actually inserted, ie. when building queries.\n"
801 gFunctionHelpTexts.insert(
"$feature", QCoreApplication::translate(
"function_help",
"<h3>$feature function</h3>\n"
802 "In atlas generation, returns the current feature number that is iterated over on the coverage layer.\n"
805 "<pre>$feature</pre>\n"
807 "<h4>Arguments</h4>\n"
811 "<pre>$feature → 2</pre>\n"
814 gFunctionHelpTexts.insert(
"lpad", QCoreApplication::translate(
"function_help",
"<h3>lpad() function</h3>\n"
815 "Returns a string with supplied width padded\n"
816 "using the fill character.\n"
819 "<code>lpad(string, length, fill)</code><br>\n"
821 "<h4>Arguments</h4>\n"
822 "<code>string</code> - is string. The string.\n"
824 "<code>length</code> - is int. The length of the new string.\n"
826 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
829 "<!-- Show example of function.-->\n"
830 "<code>lpad('Hello', 10, 'x') → 'Helloxxxxx'</code><br>\n"
832 gFunctionHelpTexts.insert(
"replace", QCoreApplication::translate(
"function_help",
"<h3>replace() function</h3>\n"
833 "Returns a string with the the supplied string replaced.\n"
835 "<p><h4>Syntax</h4>\n"
836 " replace(<i>string,before,after</i>)</p>\n"
838 "<p><h4>Arguments</h4>\n"
839 "<!-- List args for functions here-->\n"
840 "<i> string</i> → is string. The start string.<br>\n"
841 "<i> before</i> → is string. The string to replace.<br>\n"
842 "<i> after</i> → is string. The string that will replace <i>before</i><br></p>\n"
844 "<p><h4>Example</h4>\n"
845 "<!-- Show example of function.-->\n"
846 " replace('QGIS SHOULD ROCK','SHOULD','DOES') → 'QGIS DOES ROCK'</p>\n"
848 gFunctionHelpTexts.insert(
"log", QCoreApplication::translate(
"function_help",
"<h3>log() function</h3>\n"
849 "Returns the value of the logarithm of the passed value and base.\n"
851 "This function takes two arguments.\n"
853 "<code>log(base, value)</code><br>\n"
855 "<h4>Arguments</h4>\n"
856 "<code>base</code> - any positive number.<br>\n"
857 "<code>value</code> - any positive number.\n"
861 "<!-- Show example of function.-->\n"
862 "<code>log(2, 32) → 5</code><br>\n"
863 "<code>log(0.5, 32) → -5</code><br>\n"
865 gFunctionHelpTexts.insert(
"Geometry", QCoreApplication::translate(
"function_help",
"<h3>Geometry Group</h3>\n"
866 "This group contains functions that operate on geometry objects e.g length, area.\n"
868 gFunctionHelpTexts.insert(
"$perimeter", QCoreApplication::translate(
"function_help",
"<h3>$perimeter function</h3>\n"
869 "Returns the perimeter length of the current feature.\n"
872 "<pre>$perimeter</pre>\n"
874 "<h4>Arguments</h4>\n"
878 "<pre>$perimeter → 42</pre>\n"
881 gFunctionHelpTexts.insert(
"ceil", QCoreApplication::translate(
"function_help",
"<h3>ceil() function</h3>\n"
882 "Rounds a number upwards.\n"
885 "<code>ceil(value)</code><br>\n"
887 "<h4>Arguments</h4>\n"
888 "<code>value</code> - a number.\n"
892 "<!-- Show example of function.-->\n"
893 "<code>ceil(4.9) → 5</code><br>\n"
894 "<code>ceil(-4.9) → -4</code><br>\n"
896 gFunctionHelpTexts.insert(
"left", QCoreApplication::translate(
"function_help",
"<h3>left() function</h3>\n"
897 "Returns a substring that contains the <i>n</i> leftmost characters of the string.\n"
900 "<code>left(string, length)</code><br>\n"
902 "<h4>Arguments</h4>\n"
903 "<code>string</code> - is string. The string.\n"
905 "<code>length</code> - is int. The number of characters from the left to return.\n"
908 "<!-- Show example of function.-->\n"
909 "<code>left('Hello World',5) → 'Hello'</code><br>\n"
912 gFunctionHelpTexts.insert(
"$id", QCoreApplication::translate(
"function_help",
"<h3>$id function</h3>\n"
913 "Returns the feature id of the current row.\n"
918 "<h4>Arguments</h4>\n"
922 "<pre>$id → 42</pre>\n"
925 gFunctionHelpTexts.insert(
"Conditions", QCoreApplication::translate(
"function_help",
"<h3>Conditions Group</h3>\n"
926 "This group contains functions that operate on condition.\n"
928 gFunctionHelpTexts.insert(
"$scale", QCoreApplication::translate(
"function_help",
"<h3>$scale function</h3>\n"
929 "Returns the current scale of the map canvas.\n"
931 "Note: This function is only available in some contexts and will be 0 otherwise. \n"
933 "<code>$scale</code><br>\n"
936 "<!-- Show example of function.-->\n"
937 "<code>$scale → 10000</code><br>\n"
941 gFunctionHelpTexts.insert(
"$rownum", QCoreApplication::translate(
"function_help",
"<h3>$rownum function</h3>\n"
942 "Returns the number of the current row.\n"
945 "<pre>$rownum</pre>\n"
947 "<h4>Arguments</h4>\n"
951 "<pre>$rownum → 4711</pre>\n"
954 gFunctionHelpTexts.insert(
"Conditionals", QCoreApplication::translate(
"function_help",
"<h3>Conditionals Group</h3>\n"
955 "This group contains functions to handle conditional checks in expressions.\n"
957 gFunctionHelpTexts.insert(
"String", QCoreApplication::translate(
"function_help",
"<h3>String Group</h3>\n"
958 "This group contains functions that operate on strings e.g replace, convert to upper case.\n"
960 gFunctionHelpTexts.insert(
"sqrt", QCoreApplication::translate(
"function_help",
"<h3>sqrt() function</h3>\n"
961 "Returns square root of a value\n"
964 "<p><h4>Syntax</h4>\n"
965 " sqrt(<i>real</i>)</p>\n"
967 "<p><h4>Arguments</h4>\n"
968 "<i>real</i> → number.</p>\n"
970 "<p><h4>Example</h4>\n"
971 " sqrt(9) → 3</p>\n"
973 gFunctionHelpTexts.insert(
"substr", QCoreApplication::translate(
"function_help",
"<h3>substr() function</h3>\n"
974 "Return a part of a string\n"
976 "<p><h4>Syntax</h4>\n"
977 " substr(<i>string,startpos,length</i>)</p>\n"
979 "<p><h4>Arguments</h4>\n"
980 "<!-- List args for functions here-->\n"
981 "<i> string</i> → is string. The full string.<br>\n"
982 "<i> startpos</i> → is number. The start position to extract from.<br>\n"
983 "<i> length</i> → is number. The length of the string to extract.<br></p>\n"
985 "<p><h4>Example</h4>\n"
986 "<!-- Show example of function.-->\n"
987 " substr('HELLO WORLD',3,5) → 'LLO W'</p>\n"
989 gFunctionHelpTexts.insert(
"atan", QCoreApplication::translate(
"function_help",
"<h3>atan() function</h3>\n"
990 "Returns arcustanget of a value in radians.\n"
993 "<p><h4>Syntax</h4>\n"
994 " atan(<i>real</i>)</p>\n"
996 "<p><h4>Arguments</h4>\n"
997 "<i>real</i> → tan of an angle.</p>\n"
999 "<p><h4>Example</h4>\n"
1000 " atan(0.5) → 0.463647609000806</p>\n"
1002 gFunctionHelpTexts.insert(
"log10", QCoreApplication::translate(
"function_help",
"<h3>log10() function</h3>\n"
1003 "Returns the value of the base 10 logarithm of the passed expression.\n"
1005 "This function takes one argument.\n"
1007 "<code>log10(value)</code><br>\n"
1009 "<h4>Arguments</h4>\n"
1010 "<code>value</code> - any positive number.\n"
1013 "<h4>Example</h4>\n"
1014 "<!-- Show example of function.-->\n"
1015 "<code>log10(1) → 0</code><br>\n"
1016 "<code>log10(100) → 2</code><br>\n"
1018 gFunctionHelpTexts.insert(
"concat", QCoreApplication::translate(
"function_help",
"<h3>concat() function</h3>\n"
1019 "Concatenates several strings to one.\n"
1022 " concat(<i>string<i>[,<i>string</i>...])\n"
1024 "<h4>Arguments</h4>\n"
1025 "<!-- List args for functions here-->\n"
1026 "<i> string</i> → is string. a string.<br>\n"
1028 "<h4>Example</h4>\n"
1029 "<!-- Show example of function.-->\n"
1030 " concat('a','b','c','d','e') → 'abcde'\n"
1032 gFunctionHelpTexts.insert(
"Field", QCoreApplication::translate(
"function_help",
"<h3>Field</h3>\n"
1033 "Double click to add field name to expression string.\n"
1035 "Right-Click on field name to open context menu sample value loading options.\n"
1037 "<p><h4>Note:</h4>\n"
1038 "Loading field values from WFS layers isn't supported, before the layer is\n"
1039 "actually inserted, ie. when building queries.\n"
1042 gFunctionHelpTexts.insert(
"second", QCoreApplication::translate(
"function_help",
"<h3>second() function</h3>\n"
1043 "Extract the seconds from a datetime or time, or the number of seconds\n"
1044 "from a <code>Interval</code>\n"
1047 "<code>second(datetime)</code><br>\n"
1048 "<code>second(Interval)</code><br>\n"
1050 "<h4>Arguments</h4>\n"
1051 "<code>date</code> - is datetime or time. The date to extract the second from.\n"
1053 "<code>Interval</code> - is Interval. The Interval to return the number of seconds from.\n"
1055 "<h4>Example</h4>\n"
1056 "<!-- Show example of function.-->\n"
1057 "<code>second('2012-07-22T13:24:57') → 57</code><br>\n"
1058 "<code>second(tointerval('3 seconds')) → 3</code><br>\n"
1059 "<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) → 1200</code><br>\n"
1060 "<code>second(age('2012-01-01','2010-01-01')) → 63072000</code><br>\n"
1063 gFunctionHelpTexts.insert(
"$numfeatures", QCoreApplication::translate(
"function_help",
"<h3>$numfeatures function</h3>\n"
1064 "In atlas generation, returns the total number of features within the coverage layer.\n"
1067 "<pre>$numfeatures</pre>\n"
1069 "<h4>Arguments</h4>\n"
1072 "<h4>Example</h4>\n"
1073 "<pre>$numfeatures → 42</pre>\n"
1076 gFunctionHelpTexts.insert(
"format_date", QCoreApplication::translate(
"function_help",
"<h3>format_date() function</h3>\n"
1077 "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"
1080 "<code>format_date('string', 'format_string')</code><br>\n"
1082 "<h4>Arguments</h4>\n"
1083 "<code>string</code> - is string. Date/Time/DateTime string.\n"
1085 "<code>format_string</code> - is string. String template used to format the string.\n"
1090 " <th>Expression</th>\n"
1092 " <th>Output</th>\n"
1096 " <tr valign=\"top\">\n"
1099 " <td>the day as number without a leading zero (1 to 31)</td>\n"
1102 " <tr valign=\"top\">\n"
1105 " <td>the day as number with a leading zero (01 to 31)</td>\n"
1108 " <tr valign=\"top\">\n"
1111 " <td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses <a href=\n"
1112 " \"qdate.html#shortDayName\">QDate::shortDayName</a>().</td>\n"
1115 " <tr valign=\"top\">\n"
1118 " <td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses <a href=\n"
1119 " \"qdate.html#longDayName\">QDate::longDayName</a>().</td>\n"
1122 " <tr valign=\"top\">\n"
1125 " <td>the month as number without a leading zero (1-12)</td>\n"
1128 " <tr valign=\"top\">\n"
1131 " <td>the month as number with a leading zero (01-12)</td>\n"
1134 " <tr valign=\"top\">\n"
1137 " <td>the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses <a href=\n"
1138 " \"qdate.html#shortMonthName\">QDate::shortMonthName</a>().</td>\n"
1141 " <tr valign=\"top\">\n"
1144 " <td>the long localized month name (e.g. 'January' to 'December'). Uses <a href=\n"
1145 " \"qdate.html#longMonthName\">QDate::longMonthName</a>().</td>\n"
1148 " <tr valign=\"top\">\n"
1151 " <td>the year as two digit number (00-99)</td>\n"
1154 " <tr valign=\"top\">\n"
1157 " <td>the year as four digit number</td>\n"
1161 " <p>These expressions may be used for the time part of the format string:</p>\n"
1166 " <th>Expression</th>\n"
1168 " <th>Output</th>\n"
1172 " <tr valign=\"top\">\n"
1175 " <td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td>\n"
1178 " <tr valign=\"top\">\n"
1181 " <td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td>\n"
1184 " <tr valign=\"top\">\n"
1187 " <td>the hour without a leading zero (0 to 23, even with AM/PM display)</td>\n"
1190 " <tr valign=\"top\">\n"
1193 " <td>the hour with a leading zero (00 to 23, even with AM/PM display)</td>\n"
1196 " <tr valign=\"top\">\n"
1199 " <td>the minute without a leading zero (0 to 59)</td>\n"
1202 " <tr valign=\"top\">\n"
1205 " <td>the minute with a leading zero (00 to 59)</td>\n"
1208 " <tr valign=\"top\">\n"
1211 " <td>the second without a leading zero (0 to 59)</td>\n"
1214 " <tr valign=\"top\">\n"
1217 " <td>the second with a leading zero (00 to 59)</td>\n"
1220 " <tr valign=\"top\">\n"
1223 " <td>the milliseconds without leading zeroes (0 to 999)</td>\n"
1226 " <tr valign=\"top\">\n"
1229 " <td>the milliseconds with leading zeroes (000 to 999)</td>\n"
1232 " <tr valign=\"top\">\n"
1233 " <td>AP or A</td>\n"
1235 " <td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td>\n"
1238 " <tr valign=\"top\">\n"
1239 " <td>ap or a</td>\n"
1241 " <td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td>\n"
1247 "<h4>Example</h4>\n"
1248 "<!-- Show example of function.-->\n"
1249 "<code>format_date('2012-05-15','dd.mm.yyyy') → 15.05.2012</code><br>\n"
1251 gFunctionHelpTexts.insert(
"toint", QCoreApplication::translate(
"function_help",
"<h3>toint() function</h3>\n"
1252 "Converts a string to integer number. Nothing changed if a value cannot be converted to integer (e.g '123asd' is invalid).\n"
1254 "<p><h4>Syntax</h4>\n"
1255 " toint(<i>string</i>)</p>\n"
1257 "<p><h4>Arguments</h4>\n"
1258 "<!-- List args for functions here-->\n"
1259 "<i> string</i> → is string. The String to convert to integer number.</p>\n"
1261 "<p><h4>Example</h4>\n"
1262 "<!-- Show example of function.-->\n"
1263 " toint('123') → 123</p>\n"
1265 gFunctionHelpTexts.insert(
"xat", QCoreApplication::translate(
"function_help",
"<h3>xat() function</h3>\n"
1266 "Retrieves a x coordinate of the current feature\n"
1269 "<code>xat(i)</code>\n"
1271 "<h4>Arguments</h4>\n"
1272 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
1274 "<h4>Example</h4>\n"
1275 "<pre>xat(1) → 5</pre>\n"
1277 gFunctionHelpTexts.insert(
"ramp_color", QCoreApplication::translate(
"function_help",
"\n"
1278 "<h3>ramp_color() function</h3>\n"
1279 "Returns a string representing a color from a color ramp. \n"
1281 "<p><h4>Syntax</h4>\n"
1282 " ramp_color(<i>ramp_name,value</i>)</p>\n"
1284 "<p><h4>Arguments</h4>\n"
1285 "<!-- List args for functions here-->\n"
1286 "<i> ramp_name</i> → the name of the color ramp as a string, for example 'Spectral'.<br>\n"
1287 "<i> value</i> → the position on the ramp to select the color from as a real number between 0 and 1.<br>\n"
1289 "<p><h4>Example</h4>\n"
1290 "<!-- Show example of function.-->\n"
1291 " ramp_color('Spectral',0.3) → '#fdbe73'</p>\n"
1293 "<p><h4>Note:</h4>\n"
1294 "The color ramps available vary between QGIS installations. This function\n"
1295 "may not give the expected results if you move your Quantum project.\n"
1298 gFunctionHelpTexts.insert(
"asin", QCoreApplication::translate(
"function_help",
"<h3>asin() function</h3>\n"
1299 "Returns arcussinus of a value in radians.\n"
1302 "<p><h4>Syntax</h4>\n"
1303 " asin(<i>real</i>)</p>\n"
1305 "<p><h4>Arguments</h4>\n"
1306 "<i>real</i> → sin of an angle.</p>\n"
1308 "<p><h4>Example</h4>\n"
1309 " asin(1.0) → 1.5707963267949</p>\n"
1311 gFunctionHelpTexts.insert(
"todate", QCoreApplication::translate(
"function_help",
"<h3>todate() function</h3>\n"
1312 "Convert a string into Qt data type.\n"
1315 "<code>todate('string')</code><br>\n"
1317 "<h4>Arguments</h4>\n"
1318 "<code>string</code> - is string in Qt date format.\n"
1321 "<h4>Example</h4>\n"
1322 "<!-- Show example of function.-->\n"
1323 "<code>todate('2012-05-04') → 2012-05-04</code><br>") );
1324 gFunctionHelpTexts.insert(
"acos", QCoreApplication::translate(
"function_help",
"<h3>acos() function</h3>\n"
1325 "Returns arcuscosinus of a value in radians.\n"
1328 "<p><h4>Syntax</h4>\n"
1329 " acos(<i>real</i>)</p>\n"
1331 "<p><h4>Arguments</h4>\n"
1332 "<i>real</i> → cos of an angle.</p>\n"
1334 "<p><h4>Example</h4>\n"
1335 " acos(0.5) → 1.0471975511966</p>\n"
1337 gFunctionHelpTexts.insert(
"upper", QCoreApplication::translate(
"function_help",
"<h3>upper() function</h3>\n"
1338 "Converts a string to upper case letters.\n"
1340 "<p><h4>Syntax</h4>\n"
1341 " upper(<i>string</i>)</p>\n"
1343 "<p><h4>Arguments</h4>\n"
1344 "<!-- List args for functions here-->\n"
1345 "<i> string</i> → is string. The String to convert to upper case.</p>\n"
1347 "<p><h4>Example</h4>\n"
1348 "<!-- Show example of function.-->\n"
1349 " upper('hello WOrld') → 'HELLO WORLD'</p>\n"
1351 gFunctionHelpTexts.insert(
"format", QCoreApplication::translate(
"function_help",
"<h3>format() function</h3>\n"
1352 "Format a string using supplied arguments. \n"
1355 "<code>format('string', arg, [arg...n])</code><br>\n"
1357 "<h4>Arguments</h4>\n"
1358 "<code>string</code> - is string. String with Qt QString place holders. Use %1, %2, etc for placeholders. Placeholders can be repeated. \n"
1360 "<code>arg [arg...n]</code> - any type. Any number of args. \n"
1362 "<h4>Example</h4>\n"
1363 "<!-- Show example of function.-->\n"
1364 "<code>format('This %1 a %2','is', 'test') → This is a test</code><br>") );
1365 gFunctionHelpTexts.insert(
"color_hsl", QCoreApplication::translate(
"function_help",
"<h3>color_hsl() function</h3>\n"
1366 "Returns a string representation of a color based on its hue, saturation, and lightness attributes\n"
1368 "<p><h4>Syntax</h4>\n"
1369 " color_hsl(<i>hue, saturation, lightness</i>)</p>\n"
1371 "<p><h4>Arguments</h4>\n"
1372 "<!-- List args for functions here-->\n"
1373 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
1374 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1375 "<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
1377 "<p><h4>Example</h4>\n"
1378 "<!-- Show example of function.-->\n"
1379 " color_hsl(100,50,70) → '#a6d98c'</p>\n"
1381 gFunctionHelpTexts.insert(
"$y", QCoreApplication::translate(
"function_help",
"<h3>$y function</h3>\n"
1382 "Returns the y coordinate of the current feature.\n"
1387 "<h4>Arguments</h4>\n"
1390 "<h4>Example</h4>\n"
1391 "<pre>$y → 42</pre>\n"
1394 gFunctionHelpTexts.insert(
"Color", QCoreApplication::translate(
"function_help",
"\n"
1395 "<h3>Color Group</h3>\n"
1396 "This group contains functions for manipulating colors\n"
1398 gFunctionHelpTexts.insert(
"rpad", QCoreApplication::translate(
"function_help",
"<h3>rpad() function</h3>\n"
1399 "Returns a string with supplied width padded\n"
1400 "using the fill character.\n"
1403 "<code>rpad(string, width, fill)</code><br>\n"
1405 "<h4>Arguments</h4>\n"
1406 "<code>string</code> - is string. The string.\n"
1408 "<code>width</code> - is int. The length of the new string.\n"
1410 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1412 "<h4>Example</h4>\n"
1413 "<!-- Show example of function.-->\n"
1414 "<code>rpad('Hello', 10, 'x') → 'xxxxxHello'</code><br>\n"
1417 gFunctionHelpTexts.insert(
"$x", QCoreApplication::translate(
"function_help",
"<h3>$x function</h3>\n"
1418 "Returns the x coordinate of the current feature.\n"
1423 "<h4>Arguments</h4>\n"
1426 "<h4>Example</h4>\n"
1427 "<pre>$x → 42</pre>\n"
1430 gFunctionHelpTexts.insert(
"color_rgb", QCoreApplication::translate(
"function_help",
"\n"
1431 "<h3>color_rgb() function</h3>\n"
1432 "Returns a string representation of a color based on its red, green, and blue components\n"
1434 "<p><h4>Syntax</h4>\n"
1435 " color_rgb(<i>red, green, blue</i>)</p>\n"
1437 "<p><h4>Arguments</h4>\n"
1438 "<!-- List args for functions here-->\n"
1439 "<i> red</i> → the red component as an integer value from 0 to 255.<br>\n"
1440 "<i> green</i> → the green component as an integer value from 0 to 255.<br>\n"
1441 "<i> blue</i> → the blue component as an integer value from 0 to 255.<br>\n"
1443 "<p><h4>Example</h4>\n"
1444 "<!-- Show example of function.-->\n"
1445 " color_rgb(255,127,0) → '#ff7f00'</p>\n"
1447 gFunctionHelpTexts.insert(
"$area", QCoreApplication::translate(
"function_help",
"<h3>$area function</h3>\n"
1448 "Returns the area size of the current feature.\n"
1451 "<pre>$area</pre>\n"
1453 "<h4>Arguments</h4>\n"
1456 "<h4>Example</h4>\n"
1457 "<pre>$area → 42</pre>\n"
1460 gFunctionHelpTexts.insert(
"abs", QCoreApplication::translate(
"function_help",
"<h3>abs() function</h3>\n"
1461 "Returns the absolute value of a number.<br>\n"
1465 "abs(<i>value</i>)<br>\n"
1467 "<h4>Arguments</h4>\n"
1468 "<code>value</code> - a number.<br>\n"
1470 "<h4>Example</h4>\n"
1471 "<code>abs(-2) → 2</code><br>\n"
1473 gFunctionHelpTexts.insert(
"tan", QCoreApplication::translate(
"function_help",
"<h3>tan() function</h3>\n"
1474 "Returns tangent of an angle.\n"
1477 "<p><h4>Syntax</h4>\n"
1478 " tan(<i>real</i>)</p>\n"
1480 "<p><h4>Arguments</h4>\n"
1481 "<i>real</i> → angle in radians.</p>\n"
1483 "<p><h4>Example</h4>\n"
1484 " tan(1.0) → 1.5574077246549</p>\n"
1486 gFunctionHelpTexts.insert(
"sin", QCoreApplication::translate(
"function_help",
"<h3>sin() function</h3>\n"
1487 "Returns sinus of an angle.\n"
1490 "<p><h4>Syntax</h4>\n"
1491 " sin(<i>real</i>)</p>\n"
1493 "<p><h4>Arguments</h4>\n"
1494 "<i>real</i> → angle in radians.</p>\n"
1496 "<p><h4>Example</h4>\n"
1497 " sin(1.571) → 0.999999682931835</p>\n"
1499 gFunctionHelpTexts.insert(
"CASE ELSE", QCoreApplication::translate(
"function_help",
"<h3>CASE expression</h3>\n"
1500 "A conditional expression that can be used to evaluate multiple expressions and\n"
1501 "return a result.\n"
1506 " WHEN <i>condition</i> THEN <i>result</i>\n"
1508 " [ ELSE <i>result</i> ]\n"
1511 "[ ] marks optional components\n"
1513 "<h4>Arguments</h4>\n"
1514 "<!-- List args for functions here-->\n"
1515 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
1516 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
1517 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
1519 "<h4>Example</h4>\n"
1520 "<!-- Show example of function.-->\n"
1523 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
1524 " ELSE <i>\"column\"</i>\n"
1528 gFunctionHelpTexts.insert(
"todatetime", QCoreApplication::translate(
"function_help",
"<h3>todatetime() function</h3>\n"
1529 "Convert a string into Qt data time type.\n"
1532 "<code>todatetime('string')</code><br>\n"
1534 "<h4>Arguments</h4>\n"
1535 "<code>string</code> - is string in Qt date time format.\n"
1538 "<h4>Example</h4>\n"
1539 "<!-- Show example of function.-->\n"
1540 "<code>todatetime('2012-05-04 12:50:00') → 2012-05-04T12:50:00</code><br>") );
1541 gFunctionHelpTexts.insert(
"color_hsva", QCoreApplication::translate(
"function_help",
"<h3>color_hsva() function</h3>\n"
1542 "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes\n"
1544 "<p><h4>Syntax</h4>\n"
1545 " color_hsva(<i>hue, saturation, value, alpha</i>)</p>\n"
1547 "<p><h4>Arguments</h4>\n"
1548 "<!-- List args for functions here-->\n"
1549 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
1550 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1551 "<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br>\n"
1552 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1554 "<p><h4>Example</h4>\n"
1555 "<!-- Show example of function.-->\n"
1556 " color_hsva(40,100,100,200) → '255,170,0,200'</p>\n"
1558 gFunctionHelpTexts.insert(
"color_hsla", QCoreApplication::translate(
"function_help",
"<h3>color_hsla() function</h3>\n"
1559 "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes\n"
1561 "<p><h4>Syntax</h4>\n"
1562 " color_hsla(<i>hue, saturation, lightness, alpha</i>)</p>\n"
1564 "<p><h4>Arguments</h4>\n"
1565 "<!-- List args for functions here-->\n"
1566 "<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br>\n"
1567 "<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1568 "<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
1569 "<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1571 "<p><h4>Example</h4>\n"
1572 "<!-- Show example of function.-->\n"
1573 " color_hsla(100,50,70,200) → '166,217,140,200'</p>\n"
1575 gFunctionHelpTexts.insert(
"regexp_match", QCoreApplication::translate(
"function_help",
"<h3>regexp_match() function</h3>\n"
1576 "Returns true if any part of a string matches the supplied regular expression.\n"
1578 "<p><h4>Syntax</h4>\n"
1579 " regexp_match(<i>string,regex</i>)</p>\n"
1581 "<p><h4>Arguments</h4>\n"
1582 "<!-- List args for functions here-->\n"
1583 "<i> string</i> → is string. The string to test against the regular expression.<br>\n"
1584 "<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"
1586 "<p><h4>Example</h4>\n"
1587 "<!-- Show example of function.-->\n"
1588 " regexp_match('QGIS ROCKS','\\sROCKS') → 1</p>\n"