1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the documentation of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** GNU Free Documentation License
10 ** Alternatively, this file may be used under the terms of the GNU Free
11 ** Documentation License version 1.3 as published by the Free Software
12 ** Foundation and appearing in the file included in the packaging of
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
26 ****************************************************************************/
28 \page qtqml-typesystem-basictypes.html
29 \title QML Basic Types
30 \brief Description of basic types provided by the Qt QML module
32 QML supports a number of basic types.
34 A \e{basic type} is one that refers to a simple value, such as an \c int
35 or a \c string. This contrasts with a \l{qtqml-typesystem-topic.html#qml-object-types}{QML Object Types},
36 which refers to an object with properties, signals, methods and so on. Unlike an object type,
37 a basic type cannot be used to declare QML objects: it is not possible, for example, to declare an
38 \c int{} object or a \c size{} object.
40 Basic types can be used to refer to:
43 \li A single value (e.g. \l int refers to a single number, \l var can refer to a single list of items)
44 \li A value that contains a simple set of property-value pairs (e.g. \l size refers to a value with \c width and \c height attributes)
47 \sa {qtqml-typesystem-topic.html}{The QML Type System}
50 \section1 Supported Basic Types
52 Most basic types are supported by the engine by default and do not require an
53 \l {Import Statements}{Import Statement} to be used, unlike QML object types.
54 Some basic types which contain multiple property-value pairs (also known as \c{value types})
55 do require an import, as they are provided by the QtQuick module.
56 The basic types supported in QML are listed below:
58 \annotatedlist qmlbasictypes
61 \section1 Property Change Behavior for Basic Types
63 Some basic types have properties: for example, the \l font type has
64 \c pixelSize, \c family and \c bold properties. Unlike properties of
65 \l{qtqml-typesystem-topic.html#qml-object-types}{object types}, properties of
66 basic types do not provide their own property change signals. It is only possible
67 to create a property change signal handler for the basic type property itself:
72 onFont.pixelSizeChanged: doSomething()
76 onPixelSizeChanged: doSomething()
80 onFontChanged: doSomething()
84 Be aware, however, that a property change signal for a basic type is emitted
85 whenever \e any of its attributes have changed, as well as when the property itself
86 changes. Take the following code, for example:
90 onFontChanged: console.log("font changed")
92 Text { id: otherText }
96 // changing any of the font attributes, or reassigning the property
97 // to a different font value, will invoke the onFontChanged handler
98 Keys.onDigit1Pressed: font.pixelSize += 1
99 Keys.onDigit2Pressed: font.bold = !font.bold
100 Keys.onDigit3Pressed: font = otherText.font
104 In contrast, properties of an \l{qtqml-typesystem-topic.html#qml-object-types}{object type}
105 emit their own property change signals, and a property change signal handler for an object-type
106 property is only invoked when the property is reassigned to a different object value.
112 \ingroup qmlbasictypes
113 \brief a whole number, e.g. 0, 10, or -20.
115 The \c int type refers to a whole number, e.g. 0, 10, or -20.
117 The possible \c int values range from around -2000000000 to around 2000000000,
118 although most elements will only accept a reduced range (which they
119 mention in their documentation).
123 Item { width: 100; height: 200 }
126 This basic type is provided by the QML language.
128 \sa {QML Basic Types}
133 \ingroup qmlbasictypes
134 \brief a binary true/false value.
136 The \c bool type refers to a binary true/false value.
146 This basic type is provided by the QML language.
148 \sa {QML Basic Types}
153 \ingroup qmlbasictypes
155 \brief a number with a decimal point.
157 The \c real type refers to a number with decimal point, e.g. 1.2 or -29.8.
161 Item { width: 100.45; height: 150.82 }
164 \b{Note:} In QML all reals are stored in double precision, \l
165 {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
168 This basic type is provided by the QML language.
170 \sa {QML Basic Types}
175 \ingroup qmlbasictypes
177 \brief a number with a decimal point, stored in double precision.
179 The \c double type refers to a number with a decimal point and is stored in double precision, \l
180 {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point} format.
185 property double number: 32155.2355
189 This basic type is provided by the QML language.
191 \sa {QML Basic Types}
196 \ingroup qmlbasictypes
197 \brief a free form text string.
199 The \c string type refers to a free form text string in quotes, e.g. "Hello world!".
203 Text { text: "Hello world!" }
206 Strings have a \c length attribute that holds the number of
207 characters in the string.
209 QML extends the JavaScript String type with a \l {String::arg}{arg()} function
210 to support value substitution.
212 When integrating with C++, note that any QString value
213 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
214 converted into a \c string value, and vice-versa.
216 This basic type is provided by the QML language.
218 \sa {QML Basic Types}
223 \ingroup qmlbasictypes
224 \brief a resource locator.
226 The \c url type refers to a resource locator (like a file name, for example). It can be either
227 absolute, e.g. "http://qt.nokia.com", or relative, e.g. "pics/logo.png". A relative URL is
228 resolved relative to the URL of the containing component.
230 For example, the following assigns a valid URL to the \l {Image::source}
231 property, which is of type \c url:
234 Image { source: "pics/logo.png" }
237 When integrating with C++, note that any QUrl value
238 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
239 converted into a \c url value, and vice-versa.
242 \section1 Using the url type
244 When a relative URL is written to a \c url type property, it is converted
245 into a URL object, so \bold {matching the URL value against the input string
246 value will fail}. Instead, convert the string to a URL using Qt.resolvedUrl()
247 for means of comparison, and use \c toString() to get the contents of the URL:
251 source: "pics/logo.png"
253 Component.onCompleted: {
254 // This prints 'false'. Although "pics/logo.png" was the input string,
255 // it's been converted from a string to a URL, so these two are not the same.
256 console.log(source == "pics/logo.png")
258 // This prints 'true' as Qt.resovledUrl() converts the string into a
259 // URL with the correctly resolved path
260 console.log(source == Qt.resolvedUrl("pics/logo.png"))
262 // This prints the absolute path, e.g. "file:///path/to/pics/logo.png"
263 console.log(source.toString())
268 \note When referring to files stored with the \l{resources.html}{Qt Resource System}
269 from within QML, you should use "qrc:///" instead of ":/" as QML requires URL paths.
270 Relative URLs resolved from within that file will use the same protocol.
272 Additionally, URLs may contain encoded characters using the 'percent-encoding' scheme
273 specified by \l {http://tools.ietf.org/html/rfc3986}{RFC 3986}. These characters
274 will be preserved within properties of type \c url, to allow QML code to
275 construct precise URL values. An exception to this rule is the preemptive
276 decoding of directory-separator characters (\c '/') - these characters are decoded
277 to allow the URL to be correctly classified.
279 For example, a local file containing a '#' character, which would normally be
280 interpreted as the beginning of the URL 'fragment' element, can be accessed by
281 encoding the characters of the file name:
284 Image { source: encodeURIComponent("/tmp/test#1.png") }
287 This basic type is provided by the QML language.
289 \sa {QML Basic Types}
294 \ingroup qmlbasictypes
295 \brief an ARGB color value.
296 \target qmlbasictypecolor
298 The \c color type refers to an ARGB color value. It can be specified in a number of ways:
301 \li By a \l{http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color name}, such as
302 "red", "green" or "lightsteelblue".
303 \li By a hexadecimal triplet or quad in the form \c "#RRGGBB" and \c "#AARRGGBB"
304 respectively. For example, the color red corresponds to a triplet of \c "#FF0000"
305 and a slightly transparent blue to a quad of \c "#800000FF".
306 \li Using the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()},
307 \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or
308 \l{QML:Qt::tint()}{Qt.tint()} functions.
314 \inlineimage declarative-colors.png
316 \snippet qml/colors.qml colors
318 Additionally, a color type has \c r, \c g, \c b and \c a properties that refer to the
319 red, green, blue and alpha values of the color, respectively:
326 Component.onCompleted: console.log(color.r, color.g, color.b, color.a)
330 To test color values for equality, use the \l{QML:Qt::colorEqual()}{Qt.colorEqual()}
331 function. This allows colors to be accurately compared whether they are in property
332 form or in any of the acceptable string specification forms.
334 When integrating with C++, note that any QColor value
335 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
336 converted into a \c color value, and vice-versa.
338 This basic type is provided by the QtQuick import.
340 \sa {QML Basic Types}
345 \ingroup qmlbasictypes
346 \brief a value with x and y attributes.
348 The \c point type refers to a value with \c x and \c y attributes.
350 To create a \c point value, specify it as a "x,y" string:
353 CustomObject { myPointProperty: "0,20" }
356 Or use the \l{QML:Qt::point()}{Qt.point()} function:
359 CustomObject { myPointProperty: Qt.point(0, 20) }
362 When integrating with C++, note that any QPoint or QPointF value
363 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
364 converted into a \c point value. When a \c point value is passed to C++, it
365 is automatically converted into a QPointF value.
367 This basic type is provided by the QML language.
369 \sa {QML Basic Types}
374 \ingroup qmlbasictypes
375 \brief a value with width and height attributes
377 The \c size type refers to a value with has \c width and \c height attributes.
379 For example, to read the \c width and \c height values of the
380 \l {Image::sourceSize} size-type property:
384 Image { id: image; source: "logo.png" }
385 Text { text: image.sourceSize.width + "," + image.sourceSize.height }
389 To create a \c size value, specify it as a "width x height" string:
392 Image { sourceSize: "150x50" }
395 Or use the \l{QML:Qt::size()}{Qt.size()} function:
398 Image { sourceSize: Qt.size(150, 50) }
401 When integrating with C++, note that any QSize or QSizeF value
402 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
403 converted into a \c size value, and vice-versa. When a \c size value is passed to C++, it
404 is automatically converted into a QSizeF value.
406 This basic type is provided by the QML language.
408 \sa {QML Basic Types}
413 \ingroup qmlbasictypes
414 \brief a value with x, y, width and height attributes.
416 The \c rect type refers to a value with \c x, \c y, \c width and \c height attributes.
418 For example, to read the \c width and \c height values of the \l Item
419 \l {Item::}{childrenRect} rect-type type property:
423 width: childrenRect.width
424 height: childrenRect.height
426 Rectangle { width: 100; height: 100 }
430 To create a \c rect value, specify it as a "x, y, width x height" string:
433 CustomObject { myRectProperty: "50,50,100x100" }
436 Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
439 CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
442 When integrating with C++, note that any QRect or QRectF value
443 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
444 converted into a \c rect value, and vice-versa. When a \c rect value is passed to C++, it
445 is automatically converted into a QRectF value.
447 This basic type is provided by the QML language.
449 \sa {QML Basic Types}
454 \ingroup qmlbasictypes
457 The \c date type refers to a date value.
459 To create a \c date value, specify it as a "YYYY-MM-DD" string:
462 MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
465 To read a date value returned from a C++ extension class, use
466 \l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
468 When integrating with C++, note that any QDate value
469 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
470 converted into a \c date value, and vice-versa.
472 Note that the date type has comparison semantics which match
473 those of the JavaScript Date object. To compare the value
474 of two date properties, you should compare their "toString()"
477 This basic type is provided by the QML language.
479 \sa {QML Basic Types}
484 \ingroup qmlbasictypes
487 The \c time type refers to a time value.
489 To create a \c time value, specified as "hh:mm:ss":
492 MyTimePicker { time: "14:22:15" }
495 To read a time value returned from a C++ extension class, use
496 \l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
498 Note that when converting historical times to and from javascript that QDateTime and the JS Date object
499 have different methods of calculating historical daylight savings time application. This can lead to variations of one hour
500 when converting to historical local time.
502 When integrating with C++, note that any QTime value
503 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
504 converted into a \c time value, and vice-versa.
506 This basic type is provided by the QML language.
508 \sa {QML Basic Types}
513 \ingroup qmlbasictypes
514 \brief a font value with the properties of QFont.
515 \target fontbasictypedocs
517 The \c font type refers to a font value with the properties of QFont.
519 The most commonly used properties are:
522 \li \l string \c font.family
523 \li \l bool \c font.bold
524 \li \l bool \c font.italic
525 \li \l bool \c font.underline
526 \li \l real \c font.pointSize
527 \li \l int \c font.pixelSize
530 If both \c pointSize and a \c pixelSize are specified, \c pixelSize will be used.
532 The following properties are also available:
535 \li \l enumeration \c font.weight
536 \li \l bool \c font.overline
537 \li \l bool \c font.sstrikeout
538 \li \l enumeration \c font.capitalization
539 \li \l real \c font.letterSpacing
540 \li \l real \c font.wordSpacing
545 Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
548 When integrating with C++, note that any QFont value
549 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
550 converted into a \c font value, and vice-versa.
552 This basic type is provided by the QtQuick import.
554 Font weighting is classified on a scale from 0 to 99, where a weight of 0 is ultralight,
555 and 99 is extremely black. The following values are supported:
575 Capitalization supports the following values:
579 \li \c Font.MixedCase
580 \li No capitalization change is applied.
582 \li \c Font.AllUppercase
583 \li Alters the text to be rendered in all uppercase type.
585 \li \c Font.AllLowercase
586 \li Alters the text to be rendered in all lowercase type.
588 \li \c Font.SmallCaps
589 \li Alters the text to be rendered in small-caps type.
591 \li \c Font.Capitalize
592 \li Alters the text to be rendered with the first character of each word as an uppercase character.
595 \sa {QML Basic Types}
600 \ingroup qmlbasictypes
601 \brief a list of QML objects.
603 The \c list type refers to a list of QML objects.
605 A list value can be accessed in a similar way to a JavaScript array:
608 \li Values are assigned using the \c[] square bracket syntax with comma-separated values
609 \li The \c length property provides the number of items in the list
610 \li Values in the list are accessed using the \c [index] syntax
613 A \c list can only store QML objects, and cannot contain any
614 \l {QML Basic Types}{basic type} values. (To store basic types within a
615 list, use the \l var type instead.)
617 When integrating with C++, note that any QQmlListProperty value
618 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
619 converted into a \c list value, and vice-versa.
622 \section1 Using the list type
624 For example, the \l Item type has a \l {Item::}{states} list-type property that
625 can be assigned to and used as follows:
631 width: 100; height: 100
634 State { name: "activated" },
635 State { name: "deactivated" }
638 Component.onCompleted: {
639 console.log("Name of first state:", states[0].name)
640 for (var i=0; i<states.length; i++)
641 console.log("state", i, states[i].name)
646 The defined \l State objects will be added to the \c states list
647 in the order in which they are defined.
649 If the list only contains one object, the square brackets may be omitted:
655 width: 100; height: 100
656 states: State { name: "activated" }
660 Note that objects cannot be individually added to or removed from
661 the list once created; to modify the contents of a list, it must be
662 reassigned to a new list.
664 \note The \c list type is not recommended as a type for custom properties.
665 The \c var type should be used instead for this purpose as
666 lists stored by the \c var type can be manipulated with greater
667 flexibility from within QML.
669 This basic type is provided by the QML language.
671 \sa {QML Basic Types}
676 \ingroup qmlbasictypes
677 \brief a generic property type.
679 The \c var type is a generic property type that can refer to any data type.
681 It is equivalent to a regular JavaScript variable.
682 For example, var properties can store numbers, strings, objects,
683 arrays and functions:
687 property var aNumber: 100
688 property var aBool: false
689 property var aString: "Hello world!"
690 property var anotherString: String("#FF008800")
691 property var aColor: Qt.rgba(0.2, 0.3, 0.4, 0.5)
692 property var aRect: Qt.rect(10, 10, 10, 10)
693 property var aPoint: Qt.point(10, 10)
694 property var aSize: Qt.size(10, 10)
695 property var aVector3d: Qt.vector3d(100, 100, 100)
696 property var anArray: [1, 2, 3, "four", "five", (function() { return "six"; })]
697 property var anObject: { "foo": 10, "bar": 20 }
698 property var aFunction: (function() { return "one"; })
702 \section1 Change Notification Semantics
704 It is important to note that changes in regular properties of JavaScript
705 objects assigned to a var property will \b{not} trigger updates of bindings
706 that access them. The example below will display "The car has 4 wheels" as
707 the change to the wheels property will not cause the reevaluation of the
708 binding assigned to the "text" property:
712 property var car: new Object({wheels: 4})
715 text: "The car has " + car.wheels + " wheels";
718 Component.onCompleted: {
724 If the onCompleted handler instead had \tt{"car = new Object({wheels: 6})"}
725 then the text would be updated to say "The car has 6 wheels", since the
726 car property itself would be changed, which causes a change notification
729 \section1 Property Value Initialization Semantics
731 The QML syntax defines that curly braces on the right-hand-side of a
732 property value initialization assignment denote a binding assignment.
733 This can be confusing when initializing a \c var property, as empty curly
734 braces in JavaScript can denote either an expression block or an empty
735 object declaration. If you wish to initialize a \c var property to an
736 empty object value, you should wrap the curly braces in parentheses.
741 property var first: {} // nothing = undefined
742 property var second: {{}} // empty expression block = undefined
743 property var third: ({}) // empty object
747 In the previous example, the \c first property is bound to an empty
748 expression, whose result is undefined. The \c second property is bound to
749 an expression which contains a single, empty expression block ("{}"), which
750 similarly has an undefined result. The \c third property is bound to an
751 expression which is evaluated as an empty object declaration, and thus the
752 property will be initialized with that empty object value.
754 Similarly, a colon in JavaScript can be either an object property value
755 assignment, or a code label. Thus, initializing a var property with an
756 object declaration can also require parentheses:
760 property var first: { example: 'true' } // example is interpreted as a label
761 property var second: ({ example: 'true' }) // example is interpreted as a property
762 property var third: { 'example': 'true' } // example is interpreted as a property
763 Component.onCompleted: {
764 console.log(first.example) // prints 'undefined', as "first" was assigned a string
765 console.log(second.example) // prints 'true'
766 console.log(third.example) // prints 'true'
771 \section1 Using Scarce Resources with the var Type
773 A \c var type property can also hold an image or pixmap.
774 A \c var which contains a QPixmap or QImage is known as a
775 "scarce resource" and the declarative engine will attempt to
776 automatically release such resources after evaluation of any JavaScript
777 expression which requires one to be copied has completed.
779 Clients may explicitly release such a scarce resource by calling the
780 "destroy" method on the \c var property from within JavaScript. They
781 may also explicitly preserve the scarce resource by calling the
782 "preserve" method on the \c var property from within JavaScript.
783 For more information regarding the usage of a scarce resource, please
784 see \l{Scarce Resources in JavaScript}.
786 This basic type is provided by the QML language.
788 \sa {QML Basic Types}
794 \qmlbasictype variant
795 \ingroup qmlbasictypes
796 \brief a generic property type.
798 The \c variant type is a generic property type. It is obsolete and exists only to
799 support old applications; new applications should use \l var type
802 A variant type property can hold any of the \l {QML Basic Types}{basic type}
807 property variant aNumber: 100
808 property variant aString: "Hello world!"
809 property variant aBool: false
813 When integrating with C++, note that any QVariant value
814 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
815 converted into a \c variant value, and vice-versa.
818 \section1 Using Scarce Resources with the variant Type
820 A \c variant type property can also hold an image or pixmap.
821 A \c variant which contains a QPixmap or QImage is known as a
822 "scarce resource" and the declarative engine will attempt to
823 automatically release such resources after evaluation of any JavaScript
824 expression which requires one to be copied has completed.
826 Clients may explicitly release such a scarce resource by calling the
827 "destroy" method on the \c variant property from within JavaScript. They
828 may also explicitly preserve the scarce resource by calling the
829 "preserve" method on the \c variant property from within JavaScript.
830 For more information regarding the usage of a scarce resource, please
831 see \l{Scarce Resources in JavaScript}.
833 \section1 Storing Arrays and Objects
835 The \c variant type can also hold:
838 \li An array of \l {QML Basic Types}{basic type} values
839 \li A map of key-value pairs with \l {QML Basic Types}{basic-type} values
842 For example, below is an \c items array and an \c attributes map. Their
843 contents can be examined using JavaScript \c for loops. Individual array
844 values are accessible by index, and individual map values are accessible
849 property variant items: [1, 2, 3, "four", "five"]
850 property variant attributes: { 'color': 'red', 'width': 100 }
852 Component.onCompleted: {
853 for (var i=0; i<items.length; i++)
854 console.log(items[i])
856 for (var prop in attributes)
857 console.log(prop, "=", attributes[prop])
862 While this is a convenient way to store array and map-type values, you
863 must be aware that the \c items and \c attributes properties above are \e not
864 QML objects (and certainly not JavaScript object either) and the key-value
865 pairs in \c attributes are \e not QML properties. Rather, the \c items
866 property holds an array of values, and \c attributes holds a set of key-value
867 pairs. Since they are stored as a set of values, instead of as an object,
868 their contents \e cannot be modified individually:
872 property variant items: [1, 2, 3, "four", "five"]
873 property variant attributes: { 'color': 'red', 'width': 100 }
875 Component.onCompleted: {
877 console.log(items[0]) // This will still be '1'!
878 attributes.color = 'blue'
879 console.log(attributes.color) // This will still be 'red'!
884 Since it is not possible to individually add or remove items from a list or
885 object stored in a \c variant, the only way to modify its contents is to
886 reassign a new value. However, this is not efficent, as it causes the value
887 to be serialized and deserialized.
889 Additionally, since \c items and \c attributes are not QML objects, changing
890 their individual values do not trigger property change notifications. If
891 the above example had \c onNumberChanged or \c onAnimalChanged signal
892 handlers, they would not have been called. If, however, the \c items or
893 \c attributes properties themselves were reassigned to different values, then
894 such handlers would be called.
896 JavaScript programmers should also note that when a JavaScript object is
897 copied to an array or map property, the \e contents of the object (that is,
898 its key-value properties) are copied, rather than the object itself. The
899 property does not hold a reference to the original JavaScript object, and
900 extra data such as the object's JavaScript prototype chain is also lost in
903 This basic type is provided by the QML language.
905 \sa {QML Basic Types}
909 \qmlbasictype vector2d
910 \ingroup qmlbasictypes
912 \brief A vector2d type has x and y attributes.
914 A \c vector2d type has \c x and \c y attributes, otherwise
915 it is similar to the \c vector3d type. Please see the
916 documentation about the \c vector3d type for more information.
918 To create a \c vector2d value, specify it as a "x,y" string,
919 or define the components individually, or compose it with
920 the Qt.vector2d() function.
922 This basic type is provided by the QtQuick import.
924 \sa {QML Basic Types}
928 \qmlbasictype vector3d
929 \ingroup qmlbasictypes
930 \brief a value with x, y, and z attributes.
932 The \c vector3d type refers to a value with \c x, \c y, and \c z attributes.
934 To create a \c vector3d value, specify it as a "x,y,z" string:
937 Rotation { angle: 60; axis: "0,1,0" }
940 or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
943 Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
946 or as separate \c x, \c y, and \c z components:
949 Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
952 When integrating with C++, note that any QVector3D value
953 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
954 converted into a \c vector3d value, and vice-versa.
956 This basic type is provided by the QtQuick import.
958 \sa {QML Basic Types}
962 \qmlbasictype vector4d
963 \ingroup qmlbasictypes
965 \brief A vector4d type has x, y, z and w attributes.
967 A \c vector4d type has \c x, \c y, \c z and \c w attributes,
968 otherwise it is similar to the \c vector3d type. Please see the
969 documentation about the \c vector3d type for more information.
971 To create a \c vector4d value, specify it as a "x,y,z,w" string,
972 or define the components individually, or compose it with
973 the Qt.vector4d() function.
975 This basic type is provided by the QtQuick import.
977 \sa {QML Basic Types}
981 \qmlbasictype quaternion
982 \ingroup qmlbasictypes
984 \brief A quaternion type has scalar, x, y, and z attributes.
986 A \c quaternion type has \c scalar, \c x, \c y and \c z attributes,
987 otherwise it is similar to the \c vector3d type. Please see the
988 documentation about the \c vector3d type for more information.
990 To create a \c quaternion value, specify it as a "scalar,x,y,z" string,
991 or define the components individually, or compose it with
992 the Qt.quaternion() function.
994 This basic type is provided by the QtQuick import.
996 \sa {QML Basic Types}
1000 \qmlbasictype matrix4x4
1001 \ingroup qmlbasictypes
1003 \brief A matrix4x4 type is a 4-row and 4-column matrix
1005 A \c matrix4x4 type has sixteen values, but these values are
1006 largely opaque to QML. Values of this type can be composed with
1007 the Qt.matrix4x4() function.
1009 This basic type is provided by the QtQuick import.
1011 \sa {QML Basic Types}
1015 \qmlbasictype enumeration
1016 \ingroup qmlbasictypes
1017 \brief a set of named values.
1019 The \c enumeration type refers to a set of named values.
1021 Each named value can be referred to as \c {<Type>.<value>}. For
1022 example, the \l Text type has an \c AlignRight enumeration value:
1025 Text { horizontalAlignment: Text.AlignRight }
1028 (For backwards compatibility, the enumeration value may also be
1029 specified as a string, e.g. "AlignRight". This form is not
1030 recommended for new code.)
1032 When integrating with C++, note that any enumeration value
1033 \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
1034 converted into an \c enumeration value, and vice-versa.
1036 This basic type is provided by the QML language. Some enumeration values
1037 are provided by the QtQuick import.
1039 \sa {QML Basic Types}