Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
functionlist.qdoc
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3/*!
4 \page qtqml-javascript-functionlist.html
5 \title List of JavaScript Objects and Functions
6 \brief A list of objects, functions, and properties supported in QML.
7
8 This reference contains a list of objects, functions and
9 properties supported by the \l{QJSEngine}{JavaScript engine} in Qt.
10 For a detailed description, see the \l{ECMA-262} specification.
11
12 \section1 The Global Object
13
14 \section2 Value Properties
15
16 \list
17 \li \c NaN
18 \li \c Infinity
19 \li \c undefined
20 \endlist
21
22 \section2 Function Properties
23
24 \list
25 \li \c {eval(x)}
26 \li \c {parseInt(string, radix)}
27 \li \c {parseFloat(string)}
28 \li \c {isNaN(number)}
29 \li \c {isFinite(number)}
30 \li \c {decodeURI(encodedURI)}
31 \li \c {decodeURIComponent(encodedURIComponent)}
32 \li \c {encodeURI(uri)}
33 \li \c {encodeURIComponent(uriComponent)}
34 \li \c {escape(string)}
35 \li \c {unescape(string)}
36 \endlist
37
38 \section2 Constructor Properties
39
40 \list
41 \li \c Object
42 \li \c Function
43 \li \c Array
44 \li \c ArrayBuffer
45 \li \c String
46 \li \c Boolean
47 \li \c Number
48 \li \c DataView
49 \li \c Date
50 \li \c Promise
51 \li \c RegExp
52 \li \c Map
53 \li \c WeakMap
54 \li \c Set
55 \li \c WeakSet
56 \li \c SharedArrayBuffer
57 \li \c Symbol
58 \li \c Error
59 \li \c EvalError
60 \li \c RangeError
61 \li \c ReferenceError
62 \li \c SyntaxError
63 \li \c TypeError
64 \li \c URIError
65 \endlist
66
67 \section2 Other Properties
68
69 \list
70 \li \c Atomics
71 \li \c Math
72 \li \c JSON
73 \li \c Reflect
74 \li \c Proxy
75 \endlist
76
77 \section1 The Object Object
78
79 \section2 Object Constructor
80
81 \section3 Function Properties
82
83 \list
84 \li \c {getPrototypeOf(O)}
85 \li \c {setPrototypeOf(O, P)}
86 \li \c {getOwnPropertyDescriptor(O, P)}
87 \li \c {getOwnPropertyDescriptors(O)}
88 \li \c {getOwnPropertyNames(O)}
89 \li \c {getOwnPropertySymbols(O)}
90 \li \c {assign(O [, Properties])}
91 \li \c {create(O [, Properties])}
92 \li \c {defineProperty(O, P, Attributes)}
93 \li \c {defineProperties(O, Properties)}
94 \li \c {entries(O)}
95 \li \c {is(V1, V2)}
96 \li \c {keys(O)}
97 \li \c {values(O)}
98 \li \c {seal(O)}
99 \li \c {isSealed(O)}
100 \li \c {freeze(O)}
101 \li \c {isFrozen(O)}
102 \li \c {preventExtensions(O)}
103 \li \c {isExtensible(O)}
104 \endlist
105
106 \section2 Object Prototype
107
108 \section3 Function Properties
109
110 \list
111 \li \c {toString()}
112 \li \c {toLocaleString()}
113 \li \c {valueOf()}
114 \li \c {hasOwnProperty(V)}
115 \li \c {isPrototypeOf(V)}
116 \li \c {propertyIsEnumerable(V)}
117 \li \c {__defineGetter__(P, F)}
118 \li \c {__defineSetter__(P, F)}
119 \endlist
120
121 \section1 Function Objects
122
123 \section2 Function Prototype
124
125 \section3 Function Properties
126
127 \list
128 \li \c {toString()}
129 \li \c {apply(thisArg, argArray)}
130 \li \c {call(thisArg [, arg1 [, arg2, ...]])}
131 \li \c {bind((thisArg [, arg1 [, arg2, …]])}
132 \li \c {[Symbol.hasInstance](O)}
133 \endlist
134
135 \section1 Array Objects
136
137 \section2 Array Prototype Object
138
139 \section3 Function Properties
140
141 \list
142 \li \c {toString()}
143 \li \c {toLocaleString()}
144 \li \c {concat([item1 [, item2 [, ...]]])}
145 \li \c {copyWithin([item1 [, item2 [, ...]]])}
146 \li \c {entries()}
147 \li \c {fill(item [, index1 [, index2]])}
148 \li \c {join(separator)}
149 \li \c {find(callbackfn [, thisArg])} // ECMAScript 6: Added in Qt 5.9
150 \li \c {findIndex(callbackfn [, thisArg])} // ECMAScript 6: Added in Qt 5.9
151 \li \c {includes(item)}
152 \li \c {keys()}
153 \li \c {pop()}
154 \li \c {push([item1 [, item2 [, ...]]])}
155 \li \c {reverse()}
156 \li \c {shift()}
157 \li \c {slice(start, end)}
158 \li \c {sort(comparefn)}
159 \li \c {splice(start, deleteCount[, item1 [, item2 [, ...]]])}
160 \li \c {unshift([item1 [, item2 [, ...]]])}
161 \li \c {indexOf(searchElement [, fromIndex])}
162 \li \c {lastIndexOf(searchElement [, fromIndex])}
163 \li \c {every(callbackfn [, thisArg])}
164 \li \c {some(callbackfn [, thisArg])}
165 \li \c {forEach(callbackfn [, thisArg])}
166 \li \c {map(callbackfn [, thisArg])}
167 \li \c {filter(callbackfn [, thisArg])}
168 \li \c {reduce(callbackfn [, initialValue])}
169 \li \c {reduceRight(callbackfn [, initialValue])}
170 \li \c {values()}
171 \li \c {[Symbol.iterator]()}
172 \endlist
173
174 \section1 String Objects
175
176 \section2 String Prototype Object
177
178 \section3 Function Properties
179
180 \list
181 \li \c {toString()}
182 \li \c {valueOf()}
183 \li \c {charAt(pos)}
184 \li \c {charCodeAt(pos)}
185 \li \c {codePointAt(pos)}
186 \li \c {concat([string1 [, string2 [, ...]]])}
187 \li \c {endsWith(searchString [, endPosition ])} // ECMAScript 6: Added in Qt 5.8
188 \li \c {includes(searchString [, position ])} // ECMAScript 6: Added in 5.8
189 \li \c {indexOf(searchString ,position)}
190 \li \c {lastIndexOf(searchString, position)}
191 \li \c {localeCompare(that)}
192 \li \c {match(regexp)}
193 \li \c {normalize()}
194 \li \c {padEnd(length [, string])}
195 \li \c {padStart(length [, string])}
196 \li \c {repeat(count)} // ECMAScript 6: Added in Qt 5.9
197 \li \c {replace(searchValue, replaceValue)}
198 \li \c {search(regexp)}
199 \li \c {slice(start, end)}
200 \li \c {split(separator, limit)}
201 \li \c {startsWith(searchString [, position ])} // ECMAScript 6: Added in Qt 5.8
202 \li \c {substr(start, length)}
203 \li \c {substring(start, end)}
204 \li \c {toLowerCase()}
205 \li \c {toLocaleLowerCase()}
206 \li \c {toUpperCase()}
207 \li \c {toLocaleUpperCase()}
208 \li \c {trim()}
209 \li \c {[Symbol.iterator]()}
210 \endlist
211
212 Additionally, the QML engine adds the following functions to the \c String prototype:
213 \list
214 \li \l {string}{string::arg()}
215 \endlist
216
217
218 \section1 Boolean Objects
219
220 \section2 Boolean Prototype Object
221
222 \section3 Function Properties
223
224 \list
225 \li \c {toString()}
226 \li \c {valueOf()}
227 \endlist
228
229 \section1 Number Objects
230
231 \section2 Number Prototype Object
232
233 \section3 Function Properties
234
235 \list
236 \li \c {toString(radix)}
237 \li \c {toLocaleString()}
238 \li \c {valueOf()}
239 \li \c {toFixed(fractionDigits)}
240 \li \c {toExponential(fractionDigits)}
241 \li \c {toPrecision(precision)}
242 \endlist
243
244 Additionally, the QML engine adds the following functions to the \l Number prototype:
245 \list
246 \li \l {string Number::fromLocaleString(locale, number)}{fromLocaleString(locale, number)}
247 \li \l {string Number::toLocaleCurrencyString(locale, symbol)}{toLocaleCurrencyString(locale, symbol)}
248 \li \l {string Number::toLocaleString(locale, format, precision)}{toLocaleString(locale, format, precision)}
249 \endlist
250
251 \section2 The Number Object
252
253 \section3 Value Properties
254
255 \list
256 \li \c {NaN}
257 \li \c {NEGATIVE_INFINITY}
258 \li \c {POSITIVE_INFINITY}
259 \li \c {MAX_VALUE}
260 \li \c {MIN_VALUE}
261 \li \c {EPSILON} // ECMAScript 6: Added in Qt 5.8
262 \li \c {MAX_SAFE_INTEGER}
263 \li \c {MIN_SAFE_INTEGER}
264 \endlist
265
266 \section3 Function Properties
267
268 \list
269 \li \c {isFinite(x)} // ECMAScript 6: Added in Qt 5.8
270 \li \c {isInteger(x)}
271 \li \c {isSafeInteger(x)}
272 \li \c {isNaN(x)} // ECMAScript 6: Added in Qt 5.8
273 \endlist
274
275 \section1 The Math Object
276
277 \section2 Value Properties
278
279 \list
280 \li \c {E}
281 \li \c {LN10}
282 \li \c {LN2}
283 \li \c {LOG2E}
284 \li \c {LOG10E}
285 \li \c {PI}
286 \li \c {SQRT1_2}
287 \li \c {SQRT2}
288 \endlist
289
290 \section2 Function Properties
291
292 \list
293 \li \c {abs(x)}
294 \li \c {acos(x)}
295 \li \c {acosh(x)}
296 \li \c {asin(x)}
297 \li \c {asinh(x)}
298 \li \c {atan(x)}
299 \li \c {atanh(x)}
300 \li \c {atan2(y, x)}
301 \li \c {cbrt(x)}
302 \li \c {ceil(x)}
303 \li \c {clz32(x)}
304 \li \c {cos(x)}
305 \li \c {cosh(x)}
306 \li \c {exp(x)}
307 \li \c {expm1(x)}
308 \li \c {floor(x)}
309 \li \c {fround(x)}
310 \li \c {hypot(x, y)}
311 \li \c {imul(x, y)}
312 \li \c {log(x)}
313 \li \c {log10(x)}
314 \li \c {log1p(x)}
315 \li \c {log2(x)}
316 \li \c {max([value1 [, value2 [, ...]]])}
317 \li \c {min([value1 [, value2 [, ...]]])}
318 \li \c {pow(x, y)}
319 \li \c {random()}
320 \li \c {round(x)}
321 \li \c {sign(x)} // ECMAScript 6: Added in Qt 5.8
322 \li \c {sin(x)}
323 \li \c {sinh(x)}
324 \li \c {sqrt(x)}
325 \li \c {tan(x)}
326 \li \c {tanh(x)}
327 \li \c {trunc(x)}
328 \endlist
329
330 \section1 Date Objects
331
332 \section2 Date Prototype Object
333
334 \section3 Function Properties
335
336 \list
337 \li \c {toString()}
338 \li \c {toDateString()}
339 \li \c {toTimeString()}
340 \li \c {toLocaleString()}
341 \li \c {toLocaleDateString()}
342 \li \c {toLocaleTimeString()}
343 \li \c {valueOf()}
344 \li \c {getTime()}
345 \li \c {getFullYear()}
346 \li \c {getUTCFullYear()}
347 \li \c {getMonth()}
348 \li \c {getUTCMonth()}
349 \li \c {getDate()}
350 \li \c {getUTCDate()}
351 \li \c {getDay()}
352 \li \c {getUTCDay()}
353 \li \c {getHours()}
354 \li \c {getUTCHours()}
355 \li \c {getMinutes()}
356 \li \c {getUTCMinutes()}
357 \li \c {getSeconds()}
358 \li \c {getUTCSeconds()}
359 \li \c {getMilliseconds()}
360 \li \c {getUTCMilliseconds()}
361 \li \c {getTimeZoneOffset()}
362 \li \c {setTime(time)}
363 \li \c {setMilliseconds(ms)}
364 \li \c {setUTCMilliseconds(ms)}
365 \li \c {setSeconds(sec [, ms])}
366 \li \c {setUTCSeconds(sec [, ms])}
367 \li \c {setMinutes(min [, sec [, ms]])}
368 \li \c {setUTCMinutes(min [, sec [, ms]])}
369 \li \c {setHours(hour [, min [, sec [, ms]]])}
370 \li \c {setUTCHours(hour [, min [, sec [, ms]]])}
371 \li \c {setDate(date)}
372 \li \c {setUTCDate(date)}
373 \li \c {setMonth(month [, date])}
374 \li \c {setUTCMonth(month [, date])}
375 \li \c {setYear(year)}
376 \li \c {setFullYear(year [, month [, date]])}
377 \li \c {setUTCFullYear(year [, month [, date]])}
378 \li \c {toUTCString()}
379 \li \c {toGMTString()}
380 \li \c {toISOString()}
381 \li \c {toJSON()}
382 \li \c {[Symbol.toPrimitive](hint)}
383 \endlist
384
385 Additionally, the QML engine adds the following functions to the
386 \l{The Date JavaScript Object}{Date} prototype:
387 \list
388 \li \l {string Date::timeZoneUpdated()}{timeZoneUpdated()}
389 \li \l {string Date::toLocaleDateString(locale, format)}{toLocaleDateString(locale, format)}
390 \li \l {string Date::toLocaleString(locale, format)}{toLocaleString(locale, format)}
391 \li \l {string Date::toLocaleTimeString(locale, format)}{toLocaleTimeString(locale, format)}
392 \endlist
393
394 \section1 RegExp Objects
395
396 \section2 RegExp Prototype Object
397
398 \section3 Function Properties
399
400 \list
401 \li \c {exec(string)}
402 \li \c {test(string)}
403 \li \c {toString()}
404 \endlist
405
406 \section1 Error Objects
407
408 \section2 Error Prototype Object
409
410 \section3 Value Properties
411
412 \list
413 \li \c name
414 \li \c message
415 \endlist
416
417 \section3 Function Properties
418
419 \list
420 \li \c {toString()}
421 \endlist
422
423 \section1 The JSON Object
424
425 \section2 Function Properties
426
427 \list
428 \li \c {parse(text [, reviver])}
429 \li \c {stringify(value [, replacer [, space]])}
430 \endlist
431
432*/