Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /**************************************************************************** |
---|---|
2 | ** |
3 | ** Copyright (C) 2017 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the documentation of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:FDL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU Free Documentation License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU Free |
19 | ** Documentation License version 1.3 as published by the Free Software |
20 | ** Foundation and appearing in the file included in the packaging of |
21 | ** this file. Please review the following information to ensure |
22 | ** the GNU Free Documentation License version 1.3 requirements |
23 | ** will be met: https://www.gnu.org/licenses/fdl-1.3.html. |
24 | ** $QT_END_LICENSE$ |
25 | ** |
26 | ****************************************************************************/ |
27 | |
28 | /*! |
29 | \qmlmodule QtQuick 2.\QtMinorVersion |
30 | \title Qt Quick QML Types |
31 | \ingroup qmlmodules |
32 | \brief Provides graphical QML types. |
33 | |
34 | The \l{Qt Quick} module provides graphical primitive types. These types are only |
35 | available in a QML document if that document imports the \c QtQuick namespace. |
36 | |
37 | The current version of the \c QtQuick module is version \QtMinorVersion, and |
38 | thus it may be imported via the following statement: |
39 | |
40 | \qml \QtMinorVersion |
41 | import QtQuick 2.\1 |
42 | \endqml |
43 | |
44 | Visit the \l {Qt Quick} module documentation for more |
45 | information about the concepts which are central to \c QtQuick. |
46 | |
47 | \section1 Submodules |
48 | |
49 | Qt Quick includes several submodules which contain additional types. |
50 | |
51 | \list |
52 | \li \l{Qt Quick XmlListModel QML Types}{Xml List Model} - contains types |
53 | for creating models from XML data |
54 | \li \l{Qt Quick Local Storage QML Types}{Local Storage} - a submodule |
55 | containing a JavaScript interface for an SQLite database |
56 | \li \l{Qt Quick Particles QML Types}{Particles} - provides a particle |
57 | system for QML applications |
58 | \li \l{Qt Quick Window QML Types}{Window} - contains types for creating |
59 | top-level windows and accessing screen information |
60 | \li \l{Qt Quick Dialogs QML Types}{Dialogs} - contains types for creating and |
61 | interacting with system dialogs |
62 | \li \l{Qt Quick Controls QML Types}{Controls} - provides a set of reusable |
63 | UI components |
64 | \li \l{Qt Quick Layouts QML Types}{Layouts} - contains types that are used |
65 | to arrange items in the user interface |
66 | \li \l{Qt Quick Test QML Types}{Tests} - types for testing QML applications. |
67 | \endlist |
68 | |
69 | \target basic-types |
70 | \section1 Basic Types |
71 | |
72 | There are a number of basic types that are |
73 | \l{qtqml-typesystem-basictypes.html#basic-types-provided-by-the-qml-language} |
74 | {supported by default in the QML language}. |
75 | |
76 | In addition, the \c QtQuick import provides the following basic types: |
77 | \annotatedlist qtquickbasictypes |
78 | |
79 | \section1 Object Types |
80 | |
81 | Most object types provided by the \c QtQuick import are based on the \l{Item} |
82 | type, which itself derives from \l{QtQml::QtObject}{QtObject}. \l{Qt QML QML |
83 | Types#Object Types} {QML object types} provided by the Qt QML module (such as |
84 | \l{QtQml::QtObject}{QtObject} and \l{QtQml::Component}{Component}) are also |
85 | available when you import \c QtQuick. |
86 | |
87 | */ |
88 | |
89 | /*! |
90 | \qmlbasictype color |
91 | \ingroup qtquickbasictypes |
92 | \brief an ARGB color value. |
93 | \target colorbasictypedocs |
94 | |
95 | The \c color type refers to an ARGB color value. It can be specified in a number of ways: |
96 | |
97 | \list |
98 | \li By a \l{SVG Color Reference}{SVG color name}, such as "red", "green" or "lightsteelblue". |
99 | \li By a hexadecimal triplet or quad in the form \c "#RRGGBB" and \c "#AARRGGBB" |
100 | respectively. For example, the color red corresponds to a triplet of \c "#FF0000" |
101 | and a slightly transparent blue to a quad of \c "#800000FF". |
102 | \li Using the \l{QtQml::Qt::rgba()}{Qt.rgba()}, \l{QtQml::Qt::hsva()}{Qt.hsva()}, |
103 | \l{QtQml::Qt::hsla()}{Qt.hsla()}, \l{QtQml::Qt::darker()}{Qt.darker()}, |
104 | \l{QtQml::Qt::lighter()}{Qt.lighter()} or \l{QtQml::Qt::tint()}{Qt.tint()} functions. |
105 | \endlist |
106 | |
107 | Example: |
108 | |
109 | \div{float-right} |
110 | \inlineimage declarative-colors.png |
111 | \enddiv |
112 | \snippet qml/colors.qml colors |
113 | |
114 | A color type has \c r, \c g, \c b and \c a properties that refer to the red, |
115 | green, blue and alpha values of the color, respectively. Additionally it has |
116 | \c hsvHue, \c hsvSaturation, \c hsvValue and \c hslHue, \c hslSaturation, |
117 | \c hslLightness properties, which allow access to color values in HSV and HSL |
118 | color models accordingly: |
119 | |
120 | \qml |
121 | Text { |
122 | color: "red" |
123 | |
124 | // prints "1 0 0 1" |
125 | Component.onCompleted: console.log(color.r, color.g, color.b, color.a) |
126 | } |
127 | \endqml |
128 | |
129 | To test color values for equality, use the \l{QtQml::Qt::colorEqual()}{Qt.colorEqual()} |
130 | function. This allows colors to be accurately compared whether they are in property |
131 | form or in any of the acceptable string specification forms. |
132 | |
133 | When integrating with C++, note that any QColor value |
134 | \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically |
135 | converted into a \c color value, and vice-versa. |
136 | |
137 | This basic type is provided by the QtQuick import. |
138 | |
139 | \section1 SVG Color Reference |
140 | |
141 | The following table lists the available |
142 | \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG colors}: |
143 | |
144 | \include svg-colors.qdocinc |
145 | |
146 | \sa {QML Basic Types} |
147 | */ |
148 | |
149 | /*! |
150 | \qmlbasictype font |
151 | \ingroup qtquickbasictypes |
152 | \brief a font value with the properties of QFont. |
153 | \target fontbasictypedocs |
154 | |
155 | The \c font type refers to a font value with the properties of QFont. |
156 | |
157 | The most commonly used properties are: |
158 | |
159 | \list |
160 | \li \l string \c font.family |
161 | \li \l bool \c font.bold |
162 | \li \l bool \c font.italic |
163 | \li \l bool \c font.underline |
164 | \li \l real \c font.pointSize |
165 | \li \l int \c font.pixelSize |
166 | \endlist |
167 | |
168 | If both \c pointSize and a \c pixelSize are specified, \c pixelSize will be used. |
169 | |
170 | The following properties are also available: |
171 | |
172 | \list |
173 | \li \l enumeration \c font.weight |
174 | \li \l bool \c font.overline |
175 | \li \l bool \c font.strikeout |
176 | \li \l enumeration \c font.capitalization |
177 | \li \l real \c font.letterSpacing |
178 | \li \l real \c font.wordSpacing |
179 | \li \l bool \c font.kerning |
180 | \li \l bool \c font.preferShaping |
181 | \li \l enumeration \c font.hintingPreference |
182 | \endlist |
183 | |
184 | Example: |
185 | \qml |
186 | Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true } |
187 | \endqml |
188 | |
189 | When integrating with C++, note that any QFont value |
190 | \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically |
191 | converted into a \c font value, and vice-versa. |
192 | |
193 | This basic type is provided by the QtQuick import. |
194 | |
195 | Font weighting is classified on a scale from 0 to 99, where a weight of 0 is ultralight, |
196 | and 99 is extremely black. The following values are supported: |
197 | |
198 | \table |
199 | \row |
200 | \li \c Font.Thin |
201 | \li 0 |
202 | \row |
203 | \li \c Font.ExtraLight |
204 | \li 12 |
205 | \row |
206 | \li \c Font.Light |
207 | \li 25 |
208 | \row |
209 | \li \c Font.Normal |
210 | \li 50 |
211 | \row |
212 | \li \c Font.Medium |
213 | \li 57 |
214 | \row |
215 | \li \c Font.DemiBold |
216 | \li 63 |
217 | \row |
218 | \li \c Font.Bold |
219 | \li 75 |
220 | \row |
221 | \li \c Font.ExtraBold |
222 | \li 81 |
223 | \row |
224 | \li \c Font.Black |
225 | \li 87 |
226 | \endtable |
227 | |
228 | Capitalization supports the following values: |
229 | |
230 | \table |
231 | \row |
232 | \li \c Font.MixedCase |
233 | \li No capitalization change is applied. |
234 | \row |
235 | \li \c Font.AllUppercase |
236 | \li Alters the text to be rendered in all uppercase type. |
237 | \row |
238 | \li \c Font.AllLowercase |
239 | \li Alters the text to be rendered in all lowercase type. |
240 | \row |
241 | \li \c Font.SmallCaps |
242 | \li Alters the text to be rendered in small-caps type. |
243 | \row |
244 | \li \c Font.Capitalize |
245 | \li Alters the text to be rendered with the first character of each word as an uppercase character. |
246 | \endtable |
247 | |
248 | Setting the hinting preference only has an effect when using the "NativeRendering" render type. |
249 | The property supports the following values: |
250 | |
251 | \list |
252 | \value Font.PreferDefaultHinting - Use the default hinting level for the target platform. |
253 | \value Font.PreferNoHinting - If possible, render text without hinting the outlines |
254 | of the glyphs. |
255 | \value Font.PreferVerticalHinting - If possible, render text with no horizontal hinting, |
256 | but align glyphs to the pixel grid in the vertical direction. |
257 | \value Font.PreferFullHinting - If possible, render text with hinting in both horizontal and |
258 | vertical directions. |
259 | \endlist |
260 | |
261 | \sa {QML Basic Types} |
262 | */ |
263 | |
264 | /*! |
265 | \qmlbasictype vector2d |
266 | \ingroup qtquickbasictypes |
267 | |
268 | \brief A vector2d type has x and y attributes. |
269 | |
270 | A \c vector2d type has \c x and \c y attributes, otherwise |
271 | it is similar to the \c vector3d type. Please see the |
272 | documentation about the \c vector3d type for more information. |
273 | |
274 | To create a \c vector2d value, specify it as a "x,y" string, |
275 | or define the components individually, or compose it with |
276 | the Qt.vector2d() function. |
277 | |
278 | The vector2d type has the following idempotent functions which can be |
279 | invoked in QML: |
280 | \table 60% |
281 | \header |
282 | \li Function Signature |
283 | \li Description |
284 | \li Example |
285 | |
286 | \row |
287 | \li real dotProduct(vector2d other) |
288 | \li Returns the scalar real result of the dot product of \c this vector2d with the \c other vector2d |
289 | \li \code |
290 | var a = Qt.vector2d(1,2); |
291 | var b = Qt.vector2d(3,4); |
292 | var c = a.dotProduct(b); |
293 | console.log(c); // 11 |
294 | \endcode |
295 | |
296 | \row |
297 | \li vector2d times(vector2d other) |
298 | \li Returns the vector2d result of multiplying \c this vector2d with the \c other vector2d |
299 | \li \code |
300 | var a = Qt.vector2d(1,2); |
301 | var b = Qt.vector2d(3,4); |
302 | var c = a.times(b); |
303 | console.log(c.toString()); // QVector2D(3, 8) |
304 | \endcode |
305 | |
306 | \row |
307 | \li vector2d times(real factor) |
308 | \li Returns the vector2d result of multiplying \c this vector2d with the scalar \c factor |
309 | \li \code |
310 | var a = Qt.vector2d(1,2); |
311 | var b = 4.48; |
312 | var c = a.times(b); |
313 | console.log(c.toString()); // QVector2D(4.48, 8.96) |
314 | \endcode |
315 | |
316 | \row |
317 | \li vector2d plus(vector2d other) |
318 | \li Returns the vector2d result of the addition of \c this vector2d with the \c other vector2d |
319 | \li \code |
320 | var a = Qt.vector2d(1,2); |
321 | var b = Qt.vector2d(3,4); |
322 | var c = a.plus(b); |
323 | console.log(c.toString()); // QVector2D(4, 6) |
324 | \endcode |
325 | |
326 | \row |
327 | \li vector2d minus(vector2d other) |
328 | \li Returns the vector2d result of the subtraction of \c other vector2d from \c this vector2d |
329 | \li \code |
330 | var a = Qt.vector2d(1,2); |
331 | var b = Qt.vector2d(3,4); |
332 | var c = a.minus(b); |
333 | console.log(c.toString()); // QVector2D(-2, -2) |
334 | \endcode |
335 | |
336 | \row |
337 | \li vector2d normalized() |
338 | \li Returns the normalized form of \c this vector |
339 | \li \code |
340 | var a = Qt.vector2d(1,2); |
341 | var b = a.normalized(); |
342 | console.log(b.toString()); // QVector2D(0.447214, 0.894427) |
343 | \endcode |
344 | |
345 | \row |
346 | \li real length() |
347 | \li Returns the scalar real value of the length of \c this vector2d |
348 | \li \code |
349 | var a = Qt.vector2d(1,2); |
350 | var b = a.length(); |
351 | console.log(b.toString()); // 2.23606797749979 |
352 | \endcode |
353 | |
354 | \row |
355 | \li vector3d toVector3d() |
356 | \li Returns the vector3d result of converting \c this vector2d to a vector3d |
357 | \li \code |
358 | var a = Qt.vector2d(1,2); |
359 | var b = a.toVector3d(); |
360 | console.log(b.toString()); // QVector3D(1, 2, 0) |
361 | \endcode |
362 | |
363 | \row |
364 | \li vector4d toVector4d() |
365 | \li Returns the vector4d result of converting \c this vector2d to a vector4d |
366 | \li \code |
367 | var a = Qt.vector2d(1,2); |
368 | var b = a.toVector4d(); |
369 | console.log(b.toString()); // QVector4D(1, 2, 0, 0) |
370 | \endcode |
371 | |
372 | \row |
373 | \li bool fuzzyEquals(vector2d other, real epsilon) |
374 | \li Returns true if \c this vector2d is approximately equal to the \c other vector2d. |
375 | The approximation will be true if each attribute of \c this is within \c epsilon |
376 | of \c other. Note that \c epsilon is an optional argument, the default \c epsilon |
377 | is 0.00001. |
378 | \li \code |
379 | var a = Qt.vector2d(1,2); |
380 | var b = Qt.vector2d(1.0001, 1.9998); |
381 | var c = a.fuzzyEquals(b); // default epsilon |
382 | var d = a.fuzzyEquals(b, 0.005); // supplied epsilon |
383 | console.log(c + " " + d); // false true |
384 | \endcode |
385 | \endtable |
386 | |
387 | This basic type is provided by the QtQuick import. |
388 | |
389 | \sa {QML Basic Types} |
390 | */ |
391 | |
392 | /*! |
393 | \qmlbasictype vector3d |
394 | \ingroup qtquickbasictypes |
395 | \brief a value with x, y, and z attributes. |
396 | |
397 | The \c vector3d type refers to a value with \c x, \c y, and \c z attributes. |
398 | |
399 | To create a \c vector3d value, specify it as a "x,y,z" string: |
400 | |
401 | \qml |
402 | Rotation { angle: 60; axis: "0,1,0" } |
403 | \endqml |
404 | |
405 | or with the \l{QtQml::Qt::vector3d()}{Qt.vector3d()} function: |
406 | |
407 | \qml |
408 | Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) } |
409 | \endqml |
410 | |
411 | or as separate \c x, \c y, and \c z components: |
412 | |
413 | \qml |
414 | Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 } |
415 | \endqml |
416 | |
417 | Each attribute of a vector3d value is stored internally as a |
418 | single-precision floating point number (\c float). |
419 | |
420 | When integrating with C++, note that any QVector3D value |
421 | \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically |
422 | converted into a \c vector3d value, and vice-versa. |
423 | |
424 | The vector3d type has the following idempotent functions which can be |
425 | invoked in QML: |
426 | \table |
427 | \header |
428 | \li Function Signature |
429 | \li Description |
430 | \li Example |
431 | |
432 | \row |
433 | \li vector3d crossProduct(vector3d other) |
434 | \li Returns the vector3d result of the cross product of \c this vector3d with the \c other vector3d |
435 | \li \code |
436 | var a = Qt.vector3d(1,2,3); |
437 | var b = Qt.vector3d(4,5,6); |
438 | var c = a.crossProduct(b); |
439 | console.log(c.toString()); // QVector3D(-3, 6, -3) |
440 | \endcode |
441 | |
442 | \row |
443 | \li real dotProduct(vector3d other) |
444 | \li Returns the scalar real result of the dot product of \c this vector3d with the \c other vector3d |
445 | \li \code |
446 | var a = Qt.vector3d(1,2,3); |
447 | var b = Qt.vector3d(4,5,6); |
448 | var c = a.dotProduct(b); |
449 | console.log(c); // 32 |
450 | \endcode |
451 | |
452 | \row |
453 | \li vector3d times(matrix4x4 matrix) |
454 | \li Returns the vector3d result of transforming \c this vector3d with |
455 | the 4x4 \c matrix with the matrix applied post-vector |
456 | \li \code |
457 | var a = Qt.vector3d(1,2,3); |
458 | var b = Qt.matrix4x4(4,5,6,7,8,9,10,11, |
459 | 12,13,14,15,16,17,18,19); |
460 | var c = a.times(b); |
461 | console.log(c.toString()); |
462 | // QVector3D(0.774194, 0.849462, 0.924731) |
463 | \endcode |
464 | |
465 | \row |
466 | \li vector3d times(vector3d other) |
467 | \li Returns the vector3d result of multiplying \c this vector3d with the \c other vector3d |
468 | \li \code |
469 | var a = Qt.vector3d(1,2,3); |
470 | var b = Qt.vector3d(4,5,6); |
471 | var c = a.times(b); |
472 | console.log(c.toString()); // QVector3D(4, 10, 18) |
473 | \endcode |
474 | |
475 | \row |
476 | \li vector3d times(real factor) |
477 | \li Returns the vector3d result of multiplying \c this vector3d with the scalar \c factor |
478 | \li \code |
479 | var a = Qt.vector3d(1,2,3); |
480 | var b = 4.48; |
481 | var c = a.times(b); |
482 | console.log(c.toString()); // QVector3D(4.48, 8.96, 13.44) |
483 | \endcode |
484 | |
485 | \row |
486 | \li vector3d plus(vector3d other) |
487 | \li Returns the vector3d result of the addition of \c this vector3d with the \c other vector3d |
488 | \li \code |
489 | var a = Qt.vector3d(1,2,3); |
490 | var b = Qt.vector3d(4,5,6); |
491 | var c = a.plus(b); |
492 | console.log(c.toString()); // QVector3D(5, 7, 9) |
493 | \endcode |
494 | |
495 | \row |
496 | \li vector3d minus(vector3d other) |
497 | \li Returns the vector3d result of the subtraction of \c other vector3d from \c this vector3d |
498 | \li \code |
499 | var a = Qt.vector3d(1,2,3); |
500 | var b = Qt.vector3d(4,5,6); |
501 | var c = a.minus(b); |
502 | console.log(c.toString()); // QVector3D(-3, -3, -3) |
503 | \endcode |
504 | |
505 | \row |
506 | \li vector3d normalized() |
507 | \li Returns the normalized form of \c this vector |
508 | \li \code |
509 | var a = Qt.vector3d(1,2,3); |
510 | var b = a.normalized(); |
511 | console.log(b.toString()); |
512 | // QVector3D(0.267261, 0.534522, 0.801784) |
513 | \endcode |
514 | |
515 | \row |
516 | \li real length() |
517 | \li Returns the scalar real value of the length of \c this vector3d |
518 | \li \code |
519 | var a = Qt.vector3d(1,2,3); |
520 | var b = a.length(); |
521 | console.log(b.toString()); // 3.7416573867739413 |
522 | \endcode |
523 | |
524 | \row |
525 | \li vector2d toVector2d() |
526 | \li Returns the vector2d result of converting \c this vector3d to a vector2d |
527 | \li \code |
528 | var a = Qt.vector3d(1,2,3); |
529 | var b = a.toVector2d(); |
530 | console.log(b.toString()); // QVector2D(1, 2) |
531 | \endcode |
532 | |
533 | \row |
534 | \li vector4d toVector4d() |
535 | \li Returns the vector4d result of converting \c this vector3d to a vector4d |
536 | \li \code |
537 | var a = Qt.vector3d(1,2,3); |
538 | var b = a.toVector4d(); |
539 | console.log(b.toString()); // QVector4D(1, 2, 3, 0) |
540 | \endcode |
541 | |
542 | \row |
543 | \li bool fuzzyEquals(vector3d other, real epsilon) |
544 | \li Returns true if \c this vector3d is approximately equal to the \c other vector3d. |
545 | The approximation will be true if each attribute of \c this is within \c epsilon |
546 | of \c other. |
547 | Note that \c epsilon is an optional argument, the default \c epsilon |
548 | is 0.00001. |
549 | \li \code |
550 | var a = Qt.vector3d(1,2,3); |
551 | var b = Qt.vector3d(1.0001, 1.9998, 2.0001); |
552 | var c = a.fuzzyEquals(b); // default epsilon |
553 | var d = a.fuzzyEquals(b, 0.005); // supplied epsilon |
554 | console.log(c + " " + d); // false true |
555 | \endcode |
556 | \endtable |
557 | |
558 | This basic type is provided by the QtQuick import. |
559 | |
560 | \sa {QML Basic Types} |
561 | */ |
562 | |
563 | /*! |
564 | \qmlbasictype vector4d |
565 | \ingroup qtquickbasictypes |
566 | |
567 | \brief A vector4d type has x, y, z and w attributes. |
568 | |
569 | A \c vector4d type has \c x, \c y, \c z and \c w attributes, |
570 | otherwise it is similar to the \c vector3d type. Please see the |
571 | documentation about the \c vector3d type for more information. |
572 | |
573 | To create a \c vector4d value, specify it as a "x,y,z,w" string, |
574 | or define the components individually, or compose it with |
575 | the Qt.vector4d() function. |
576 | |
577 | The vector4d type has the following idempotent functions which can be |
578 | invoked in QML: |
579 | \table |
580 | \header |
581 | \li Function Signature |
582 | \li Description |
583 | \li Example |
584 | |
585 | \row |
586 | \li real dotProduct(vector4d other) |
587 | \li Returns the scalar real result of the dot product of \c this vector4d with the \c other vector4d |
588 | \li \code |
589 | var a = Qt.vector4d(1,2,3,4); |
590 | var b = Qt.vector4d(5,6,7,8); |
591 | var c = a.dotProduct(b); |
592 | console.log(c); // 70 |
593 | \endcode |
594 | |
595 | \row |
596 | \li vector4d times(matrix4x4 matrix) |
597 | \li Returns the vector4d result of transforming \c this vector4d with |
598 | the 4x4 \c matrix with the matrix applied post-vector |
599 | \li \code |
600 | var a = Qt.vector4d(1,2,3,4); |
601 | var b = Qt.matrix4x4(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19); |
602 | var c = a.times(b); |
603 | console.log(c.toString()); // QVector4D(120, 130, 140, 150) |
604 | \endcode |
605 | |
606 | \row |
607 | \li vector4d times(vector4d other) |
608 | \li Returns the vector4d result of multiplying \c this vector4d with the \c other vector4d |
609 | \li \code |
610 | var a = Qt.vector4d(1,2,3,4); |
611 | var b = Qt.vector4d(5,6,7,8); |
612 | var c = a.times(b); |
613 | console.log(c.toString()); // QVector4D(5, 12, 21, 32) |
614 | \endcode |
615 | |
616 | \row |
617 | \li vector4d times(real factor) |
618 | \li Returns the vector4d result of multiplying \c this vector4d with the scalar \c factor |
619 | \li \code |
620 | var a = Qt.vector4d(1,2,3,4); |
621 | var b = 4.48; |
622 | var c = a.times(b); |
623 | console.log(c.toString()); // QVector3D(4.48, 8.96, |
624 | 13.44, 17.92) |
625 | \endcode |
626 | |
627 | \row |
628 | \li vector4d plus(vector4d other) |
629 | \li Returns the vector4d result of the addition of \c this vector4d with the \c other vector4d |
630 | \li \code |
631 | var a = Qt.vector4d(1,2,3,4); |
632 | var b = Qt.vector4d(5,6,7,8); |
633 | var c = a.plus(b); |
634 | console.log(c.toString()); // QVector4D(6, 8, 10, 12) |
635 | \endcode |
636 | |
637 | \row |
638 | \li vector4d minus(vector4d other) |
639 | \li Returns the vector4d result of the subtraction of \c other vector4d from \c this vector4d |
640 | \li \code |
641 | var a = Qt.vector4d(1,2,3,4); |
642 | var b = Qt.vector4d(5,6,7,8); |
643 | var c = a.minus(b); |
644 | console.log(c.toString()); // QVector4D(-4, -4, -4, -4) |
645 | \endcode |
646 | |
647 | \row |
648 | \li vector4d normalized() |
649 | \li Returns the normalized form of \c this vector |
650 | \li \code |
651 | var a = Qt.vector4d(1,2,3,4); |
652 | var b = a.normalized(); |
653 | console.log(b.toString()); |
654 | // QVector4D(0.182574, 0.365148, 0.547723, 0.730297) |
655 | \endcode |
656 | |
657 | \row |
658 | \li real length() |
659 | \li Returns the scalar real value of the length of \c this vector3d |
660 | \li \code |
661 | var a = Qt.vector4d(1,2,3,4); |
662 | var b = a.length(); |
663 | console.log(b.toString()); // 5.477225575051661 |
664 | \endcode |
665 | |
666 | \row |
667 | \li vector2d toVector2d() |
668 | \li Returns the vector2d result of converting \c this vector4d to a vector2d |
669 | \li \code |
670 | var a = Qt.vector4d(1,2,3,4); |
671 | var b = a.toVector2d(); |
672 | console.log(b.toString()); // QVector2D(1, 2) |
673 | \endcode |
674 | |
675 | \row |
676 | \li vector3d toVector3d() |
677 | \li Returns the vector3d result of converting \c this vector4d to a vector3d |
678 | \li \code |
679 | var a = Qt.vector4d(1,2,3,4); |
680 | var b = a.toVector3d(); |
681 | console.log(b.toString()); // QVector3D(1, 2, 3) |
682 | \endcode |
683 | |
684 | \row |
685 | \li bool fuzzyEquals(vector4d other, real epsilon) |
686 | \li Returns true if \c this vector4d is approximately equal to the \c other vector4d. |
687 | The approximation will be true if each attribute of \c this is within \c epsilon |
688 | of \c other. Note that \c epsilon is an optional argument, the default \c epsilon |
689 | is 0.00001. |
690 | \li \code |
691 | var a = Qt.vector4d(1,2,3,4); |
692 | var b = Qt.vector4d(1.0001, 1.9998, 2.0001, 3.9999); |
693 | var c = a.fuzzyEquals(b); // default epsilon |
694 | var d = a.fuzzyEquals(b, 0.005); // supplied epsilon |
695 | console.log(c + " " + d); // false true |
696 | \endcode |
697 | \endtable |
698 | |
699 | This basic type is provided by the QtQuick import. |
700 | |
701 | \sa {QML Basic Types} |
702 | */ |
703 | |
704 | /*! |
705 | \qmlbasictype quaternion |
706 | \ingroup qtquickbasictypes |
707 | |
708 | \brief A quaternion type has scalar, x, y, and z attributes. |
709 | |
710 | A \c quaternion type has \c scalar, \c x, \c y and \c z attributes. |
711 | |
712 | To create a \c quaternion value, specify it as a "scalar,x,y,z" string, |
713 | or define the components individually, or compose it with |
714 | the Qt.quaternion() function. |
715 | |
716 | This basic type is provided by the QtQuick import. |
717 | |
718 | \sa {QML Basic Types} |
719 | */ |
720 | |
721 | /*! |
722 | \qmlbasictype matrix4x4 |
723 | \ingroup qtquickbasictypes |
724 | |
725 | \brief A matrix4x4 type is a 4-row and 4-column matrix |
726 | |
727 | A \c matrix4x4 type has sixteen values, each accessible via the properties |
728 | \c m11 through \c m44 in QML (in row/column order). Values of this type |
729 | can be composed with the Qt.matrix4x4() function. Each attribute in a |
730 | matrix4x4 is stored as a real (single-precision on ARM, double-precision |
731 | on x86). |
732 | |
733 | The matrix4x4 type has the following idempotent functions which can be |
734 | invoked in QML: |
735 | \table 70 % |
736 | \header |
737 | \li Function Signature |
738 | \li Description |
739 | \li Example |
740 | |
741 | \row |
742 | \li matrix4x4 times(matrix4x4 other) |
743 | \li Returns the matrix4x4 result of multiplying \c this matrix4x4 with |
744 | the \c other matrix4x4 |
745 | \li \code |
746 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
747 | var b = Qt.matrix4x4(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19); |
748 | var c = a.times(b); |
749 | console.log(c.toString()); |
750 | // QMatrix4x4(120, 130, 140, 150, 280, 306, 332, 358, 440, 482, |
751 | //524, 566, 600, 658, 716, 774) |
752 | \endcode |
753 | |
754 | \row |
755 | \li vector4d times(vector4d vector) |
756 | \li Returns the vector4d result of transforming the \c vector |
757 | according to \c this matrix4x4 with the matrix applied |
758 | pre-vector |
759 | \li \code |
760 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
761 | var b = Qt.vector4d(5,6,7,8); |
762 | var c = a.times(b); |
763 | console.log(c.toString()); // QVector4D(70, 174, 278, 382) |
764 | \endcode |
765 | |
766 | \row |
767 | \li vector3d times(vector3d vector) |
768 | \li Returns the vector3d result of transforming the \c vector |
769 | according to \c this matrix4x4 with the matrix applied |
770 | pre-vector |
771 | \li \code |
772 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
773 | var b = Qt.vector3d(5,6,7); |
774 | var c = a.times(b); |
775 | console.log(c.toString()); // QVector3D(0.155556, 0.437037, 0.718518) |
776 | \endcode |
777 | |
778 | \row |
779 | \li matrix4x4 times(real factor) |
780 | \li Returns the matrix4x4 result of multiplying \c this matrix4x4 with the scalar \c factor |
781 | \li \code |
782 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
783 | var b = 4.48; |
784 | var c = a.times(b); |
785 | console.log(c.toString()); |
786 | // QMatrix4x4(4.48, 8.96, 13.44, 17.92, 22.4, 26.88, 31.36, 35.84, |
787 | // 40.32, 44.8, 49.28, 53.76, 58.24, 62.72, 67.2, 71.68) |
788 | \endcode |
789 | |
790 | \row |
791 | \li matrix4x4 plus(matrix4x4 other) |
792 | \li Returns the matrix4x4 result of the addition of \c this matrix4x4 with the \c other matrix4x4 |
793 | \li \code |
794 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
795 | var b = Qt.matrix4x4(5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); |
796 | var c = a.plus(b); |
797 | console.log(c.toString()); |
798 | // QMatrix4x4(6, 8, 10, 12, 14, 16, 18, 20, 22, |
799 | // 24, 26, 28, 30, 32, 34, 36) |
800 | \endcode |
801 | |
802 | \row |
803 | \li matrix4x4 minus(matrix4x4 other) |
804 | \li Returns the matrix4x4 result of the subtraction of \c other matrix4x4 from \c this matrix4x4 |
805 | \li \code |
806 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
807 | var b = Qt.matrix4x4(5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); |
808 | var c = a.minus(b); |
809 | console.log(c.toString()); |
810 | // QMatrix4x4(-4, -4, -4, -4, -4, -4, -4, -4, -4, |
811 | // -4, -4, -4, -4, -4, -4, -4) |
812 | \endcode |
813 | |
814 | \row |
815 | \li vector4d row(int which) |
816 | \li Returns the vector4d row of \c this specified by \c which. |
817 | Note: the \c which is 0-based access into the matrix. |
818 | \li \code |
819 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
820 | var b = Qt.vector4d(a.m21, a.m22, a.m23, a.m24); |
821 | var c = a.row(2); // zero based access! so not equal to b |
822 | console.log(b.toString() + " " + c.toString()); |
823 | // QVector4D(5, 6, 7, 8) QVector4D(9, 10, 11, 12) |
824 | \endcode |
825 | |
826 | \row |
827 | \li vector4d column(int which) |
828 | \li Returns the vector4d column of \c this specified by \c which. |
829 | Note: the \c which is 0-based access into the matrix. |
830 | \li \code |
831 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
832 | var b = Qt.vector4d(a.m12, a.m22, a.m32, a.m42); |
833 | var c = a.column(2); // zero based access! so not equal to b |
834 | console.log(b.toString() + " " + c.toString()); |
835 | // QVector4D(2, 6, 10, 14) QVector4D(3, 7, 11, 15) |
836 | \endcode |
837 | |
838 | \row |
839 | \li real determinant() |
840 | \li Returns the determinant of \c this matrix4x4 |
841 | \li \code |
842 | var a = Qt.matrix4x4(1,0,0,0,0,2,0,0,0,0,3,0,100,200,300,1); |
843 | var b = a.determinant(); |
844 | console.log(b); // 6 |
845 | \endcode |
846 | |
847 | \row |
848 | \li matrix4x4 inverted() |
849 | \li Returns the inverse of \c this matrix4x4 if it exists, else the identity matrix. |
850 | \li \code |
851 | var a = Qt.matrix4x4(1,0,0,0,0,2,0,0,0,0,3,0,100,200,300,1); |
852 | var b = a.inverted(); |
853 | console.log(b.toString()); |
854 | // QMatrix4x4(1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0.333333, 0, -100, |
855 | // -100, -100, 1) |
856 | \endcode |
857 | |
858 | \row |
859 | \li matrix4x4 transposed() |
860 | \li Returns the transpose of \c this matrix4x4 |
861 | \li \code |
862 | var a = Qt.matrix4x4(1,0,0,0,0,2,0,0,0,0,3,0,100,200,300,1); |
863 | var b = a.transposed(); |
864 | console.log(b.toString()); |
865 | // QMatrix4x4(1, 0, 0, 100, 0, 2, 0, 200, 0, 0, 3, 300, 0, 0, 0, 1) |
866 | \endcode |
867 | |
868 | \row |
869 | \li bool fuzzyEquals(matrix4x4 other, real epsilon) |
870 | \li Returns true if \c this matrix4x4 is approximately equal to the \c other matrix4x4. |
871 | The approximation will be true if each attribute of \c this is within \c epsilon |
872 | of the respective attribute of \c other. Note that \c epsilon is an optional |
873 | argument, the default \c epsilon is 0.00001. |
874 | \li \code |
875 | var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); |
876 | var b = Qt.matrix4x4(1.0001,2.0001,3.0002,4.0003,5.0001,6.0002, |
877 | 7.0002,8.0004, 9.0001,10.0003, |
878 | 11.0003,12.0004,13.0001, |
879 | 14.0002,15.0003,16.0004); |
880 | var c = a.fuzzyEquals(b); // default epsilon |
881 | var d = a.fuzzyEquals(b, 0.005); // supplied epsilon |
882 | console.log(c + " " + d); // false true |
883 | \endcode |
884 | \endtable |
885 | |
886 | This basic type is provided by the QtQuick import. |
887 | |
888 | \sa {QML Basic Types} |
889 | */ |
890 |
Warning: That file was not part of the compilation database. It may have many parsing errors.