aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/javascript/functionlist.qdoc
blob: 2386ecda74f2ffef417693882da02fbf5fd0f8f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.  Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
    \page qtqml-javascript-functionlist.html
    \title List of JavaScript Objects and Functions
    \brief A list of objects, functions, and properties supported in QML.

    This reference contains a list of objects, functions and
    properties supported by the \l{QQmlEngine}{QML engine}. For a detailed
    description, see the \l{ECMA-262} specification.

    \section1 The Global Object

    \section2 Value Properties

    \list
    \li NaN
    \li Infinity
    \li undefined
    \endlist

    \section2 Function Properties

    \list
    \li eval(x)
    \li parseInt(string, radix)
    \li parseFloat(string)
    \li isNaN(number)
    \li isFinite(number)
    \li decodeURI(encodedURI)
    \li decodeURIComponent(encodedURIComponent)
    \li encodeURI(uri)
    \li encodeURIComponent(uriComponent)
    \endlist

    \section2 Constructor Properties

    \list
    \li Object
    \li Function
    \li Array
    \li String
    \li Boolean
    \li Number
    \li Date
    \li RegExp
    \li Error
    \li EvalError
    \li RangeError
    \li ReferenceError
    \li SyntaxError
    \li TypeError
    \li URIError
    \endlist

    \section2 Other Properties

    \list
    \li Math
    \li JSON
    \endlist

    \section1 The Object Object

    \section2 Object Constructor

    \section3 Function Properties

    \list
    \li getPrototypeOf(O)
    \li getOwnPropertyDescriptor(O, P)
    \li getOwnPropertyNames(O)
    \li create(O [, Properties])
    \li defineProperty(O, P, Attributes)
    \li defineProperties(O, Properties)
    \li keys(O)
    \li seal(O)
    \li isSealed(O)
    \li freeze(O)
    \li isFrozen(O)
    \li preventExtensions(O)
    \li isExtensible(O)
    \endlist

    \section2 Object Prototype

    \section3 Function Properties

    \list
    \li toString()
    \li toLocaleString()
    \li valueOf()
    \li hasOwnProperty(V)
    \li isPrototypeOf(V)
    \li propertyIsEnumerable(V)
    \endlist

    \section1 Function Objects

    \section2 Function Prototype

    \section3 Function Properties

    \list
    \li toString()
    \li apply(thisArg, argArray)
    \li call(thisArg [, arg1 [, arg2, ...]])
    \li bind((thisArg [, arg1 [, arg2, …]])
    \endlist

    \section1 Array Objects

    \section2 Array Prototype Object

    \section3 Function Properties

    \list
    \li toString()
    \li toLocaleString()
    \li concat([item1 [, item2 [, ...]]])
    \li join(separator)
    \li pop()
    \li push([item1 [, item2 [, ...]]])
    \li reverse()
    \li shift()
    \li slice(start, end)
    \li sort(comparefn)
    \li splice(start, deleteCount[, item1 [, item2 [, ...]]])
    \li unshift([item1 [, item2 [, ...]]])
    \li indexOf(searchElement [, fromIndex])
    \li lastIndexOf(searchElement [, fromIndex])
    \li every(callbackfn [, thisArg])
    \li some(callbackfn [, thisArg])
    \li forEach(callbackfn [, thisArg])
    \li map(callbackfn [, thisArg])
    \li filter(callbackfn [, thisArg])
    \li reduce(callbackfn [, initialValue])
    \li reduceRight(callbackfn [, initialValue])
    \endlist

    \section1 String Objects

    \section2 String Prototype Object

    \section3 Function Properties

    \list
    \li toString()
    \li valueOf()
    \li charAt(pos)
    \li charCodeAt(pos)
    \li concat([string1 [, string2 [, ...]]])
    \li indexOf(searchString ,position)
    \li lastIndexOf(searchString, position)
    \li localeCompare(that)
    \li match(regexp)
    \li replace(searchValue, replaceValue)
    \li search(regexp)
    \li slice(start, end)
    \li split(separator, limit)
    \li substring(start, end)
    \li toLowerCase()
    \li toLocaleLowerCase()
    \li toUpperCase()
    \li toLocaleUpperCase()
    \li trim()
    \endlist

    Additionally, the QML engine adds the following functions to the \l String prototype:
    \list
    \li \l {String::arg}{arg()}
    \endlist


    \section1 Boolean Objects

    \section2 Boolean Prototype Object

    \section3 Function Properties

    \list
    \li toString()
    \li valueOf()
    \endlist

    \section1 Number Objects

    \section2 Number Prototype Object

    \section3 Function Properties

    \list
    \li toString(radix)
    \li toLocaleString()
    \li toFixed(fractionDigits)
    \li toExponential(fractionDigits)
    \li toPrecision(precision)
    \endlist

    Additionally, the QML engine adds the following functions to the \l Number prototype:
    \list
    \li \l {Number::fromLocaleString}{fromLocaleString(locale, number)}
    \li \l {Number::toLocaleCurrencyString}{toLocaleCurrencyString(locale, symbol)}
    \li \l {Number::toLocaleString}{toLocaleString(locale, format, precision)}
    \endlist

    \section1 The Math Object

    \section2 Value Properties

    \list
    \li E
    \li LN10
    \li LN2
    \li LOG2E
    \li LOG10E
    \li PI
    \li SQRT1_2
    \li SQRT2
    \endlist

    \section2 Function Properties

    \list
    \li abs(x)
    \li acos(x)
    \li asin(x)
    \li atan(x)
    \li atan2(y, x)
    \li ceil(x)
    \li cos(x)
    \li exp(x)
    \li floor(x)
    \li log(x)
    \li max([value1 [, value2 [, ...]]])
    \li min([value1 [, value2 [, ...]]])
    \li pow(x, y)
    \li random()
    \li round(x)
    \li sin(x)
    \li sqrt(x)
    \li tan(x)
    \endlist

    \section1 Date Objects

    \section2 Date Prototype Object

    \section3 Function Properties

    \list
    \li toString()
    \li toDateString()
    \li toTimeString()
    \li toLocaleString()
    \li toLocaleDateString()
    \li toLocaleTimeString()
    \li valueOf()
    \li getTime()
    \li getFullYear()
    \li getUTCFullYear()
    \li getMonth()
    \li getUTCMonth()
    \li getDate()
    \li getUTCDate()
    \li getDay()
    \li getUTCDay()
    \li getHours()
    \li getUTCHours()
    \li getMinutes()
    \li getUTCMinutes()
    \li getSeconds()
    \li getUTCSeconds()
    \li getMilliseconds()
    \li getUTCMilliseconds()
    \li getTimeZoneOffset()
    \li setTime(time)
    \li setMilliseconds(ms)
    \li setUTCMilliseconds(ms)
    \li setSeconds(sec [, ms])
    \li setUTCSeconds(sec [, ms])
    \li setMinutes(min [, sec [, ms]])
    \li setUTCMinutes(min [, sec [, ms]])
    \li setHours(hour [, min [, sec [, ms]]])
    \li setUTCHours(hour [, min [, sec [, ms]]])
    \li setDate(date)
    \li setUTCDate(date)
    \li setMonth(month [, date])
    \li setUTCMonth(month [, date])
    \li setFullYear(year [, month [, date]])
    \li setUTCFullYear(year [, month [, date]])
    \li toUTCString()
    \li toISOString()
    \li toJSON()
    \endlist

    Additionally, the QML engine adds the following functions to the \l Date prototype:
    \list
    \li \l {Date::timeZoneUpdated}{timeZoneUpdated()}
    \li \l {Date::toLocaleDateString}{toLocaleDateString(locale, format)}
    \li \l {Date::toLocaleString}{toLocaleString(locale, format)}
    \li \l {Date::toLocaleTimeString}{toLocaleTimeString(locale, format)}
    \endlist

    \section1 RegExp Objects

    \section2 RegExp Prototype Object

    \section3 Function Properties

    \list
    \li exec(string)
    \li test(string)
    \li toString()
    \endlist

    \section1 Error Objects

    \section2 Error Prototype Object

    \section3 Value Properties

    \list
    \li name
    \li message
    \endlist

    \section3 Function Properties

    \list
    \li toString()
    \endlist

    \section1 The JSON Object

    \section2 Function Properties

    \list
    \li parse(text [, reviver])
    \li stringify(value [, replacer [, space]])
    \endlist

*/