aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-09-12 08:01:21 +0200
committerLiang Qi <liang.qi@qt.io>2019-09-12 08:01:21 +0200
commitc80eb38354854f2ccc7ea070a9857409acc36792 (patch)
tree806cb68b337ac7c8ab8f9a48538e6e0211f57ed8 /src/qml/qml
parentd38bac596946c3dd9cce3c0b4127509421dc917d (diff)
parentf19ec4561b4975d68290593b599d3c38d0f9f6d3 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: src/qml/jsruntime/qv4engine.cpp src/quick/handlers/qquicktaphandler.cpp src/quick/items/qquicktableview.cpp Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io> Done-With: Ulf Hermann <ulf.hermann@qt.io> Done-With: Shawn Rutledge <shawn.rutledge@qt.io> Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/ftw/qintrusivelist.cpp4
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp198
2 files changed, 116 insertions, 86 deletions
diff --git a/src/qml/qml/ftw/qintrusivelist.cpp b/src/qml/qml/ftw/qintrusivelist.cpp
index eb337a4de0..2ebaffb375 100644
--- a/src/qml/qml/ftw/qintrusivelist.cpp
+++ b/src/qml/qml/ftw/qintrusivelist.cpp
@@ -150,6 +150,10 @@ Returns an STL-style iterator pointing to the imaginary item after the last item
Remove the current object from the list, and return an iterator to the next element.
*/
+/*!
+ \class QIntrusiveListNode
+ \internal
+*/
/*!
\fn QIntrusiveListNode::QIntrusiveListNode()
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 355150b786..d634a48443 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -229,8 +229,10 @@ OwnPropertyKeyIterator *QtObject::virtualOwnPropertyKeys(const Object *m, Value
}
/*!
-\qmlmethod bool Qt::isQtObject(object)
-Returns true if \c object is a valid reference to a Qt or QML object, otherwise false.
+ \qmlmethod bool Qt::isQtObject(object)
+
+ Returns \c true if \a object is a valid reference to a Qt or QML object,
+ \c false otherwise.
*/
ReturnedValue QtObject::method_isQtObject(const FunctionObject *, const Value *, const Value *argv, int argc)
{
@@ -241,10 +243,10 @@ ReturnedValue QtObject::method_isQtObject(const FunctionObject *, const Value *,
}
/*!
-\qmlmethod color Qt::rgba(real red, real green, real blue, real alpha)
+ \qmlmethod color Qt::rgba(real red, real green, real blue, real alpha)
-Returns a color with the specified \c red, \c green, \c blue and \c alpha components.
-All components should be in the range 0-1 inclusive.
+ Returns a color with the specified \a red, \a green, \a blue, and \a alpha
+ components. All components should be in the range 0-1 (inclusive).
*/
ReturnedValue QtObject::method_rgba(const FunctionObject *f, const Value *, const Value *argv, int argc)
{
@@ -270,10 +272,10 @@ ReturnedValue QtObject::method_rgba(const FunctionObject *f, const Value *, cons
}
/*!
-\qmlmethod color Qt::hsla(real hue, real saturation, real lightness, real alpha)
+ \qmlmethod color Qt::hsla(real hue, real saturation, real lightness, real alpha)
-Returns a color with the specified \c hue, \c saturation, \c lightness and \c alpha components.
-All components should be in the range 0-1 inclusive.
+ Returns a color with the specified \a hue, \a saturation, \a lightness, and \a alpha
+ components. All components should be in the range 0-1 (inclusive).
*/
ReturnedValue QtObject::method_hsla(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -300,12 +302,12 @@ ReturnedValue QtObject::method_hsla(const FunctionObject *b, const Value *, cons
}
/*!
-\qmlmethod color Qt::hsva(real hue, real saturation, real value, real alpha)
+ \since 5.5
+ \qmlmethod color Qt::hsva(real hue, real saturation, real value, real alpha)
-Returns a color with the specified \c hue, \c saturation, \c value and \c alpha components.
-All components should be in the range 0-1 inclusive.
+ Returns a color with the specified \a hue, \a saturation, \a value and \a alpha
+ components. All components should be in the range 0-1 (inclusive).
-\since 5.5
*/
ReturnedValue QtObject::method_hsva(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -328,12 +330,12 @@ ReturnedValue QtObject::method_hsva(const FunctionObject *b, const Value *, cons
}
/*!
-\qmlmethod color Qt::colorEqual(color lhs, string rhs)
+ \qmlmethod color Qt::colorEqual(color lhs, string rhs)
-Returns true if both \c lhs and \c rhs yield equal color values. Both arguments
-may be either color values or string values. If a string value is supplied it
-must be convertible to a color, as described for the \l{colorbasictypedocs}{color}
-basic type.
+ Returns \c true if both \a lhs and \a rhs yield equal color values. Both
+ arguments may be either color values or string values. If a string value
+ is supplied it must be convertible to a color, as described for the
+ \l{colorbasictypedocs}{color} basic type.
*/
ReturnedValue QtObject::method_colorEqual(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -368,11 +370,9 @@ ReturnedValue QtObject::method_colorEqual(const FunctionObject *b, const Value *
}
/*!
-\qmlmethod rect Qt::rect(int x, int y, int width, int height)
-
-Returns a \c rect with the top-left corner at \c x, \c y and the specified \c width and \c height.
+ \qmlmethod rect Qt::rect(int x, int y, int width, int height)
-The returned object has \c x, \c y, \c width and \c height attributes with the given values.
+ Returns a rect with the top-left corner at \a x, \a y and the specified \a width and \a height.
*/
ReturnedValue QtObject::method_rect(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -389,8 +389,9 @@ ReturnedValue QtObject::method_rect(const FunctionObject *b, const Value *, cons
}
/*!
-\qmlmethod point Qt::point(int x, int y)
-Returns a Point with the specified \c x and \c y coordinates.
+ \qmlmethod point Qt::point(int x, int y)
+
+ Returns a point with the specified \a x and \a y coordinates.
*/
ReturnedValue QtObject::method_point(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -405,8 +406,9 @@ ReturnedValue QtObject::method_point(const FunctionObject *b, const Value *, con
}
/*!
-\qmlmethod Qt::size(int width, int height)
-Returns a Size with the specified \c width and \c height.
+ \qmlmethod size Qt::size(int width, int height)
+
+ Returns a size with the specified \a width and \a height.
*/
ReturnedValue QtObject::method_size(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -421,12 +423,13 @@ ReturnedValue QtObject::method_size(const FunctionObject *b, const Value *, cons
}
/*!
-\qmlmethod Qt::font(object fontSpecifier)
-Returns a Font with the properties specified in the \c fontSpecifier object
-or the nearest matching font. The \c fontSpecifier object should contain
-key-value pairs where valid keys are the \l{fontbasictypedocs}{font} type's
-subproperty names, and the values are valid values for each subproperty.
-Invalid keys will be ignored.
+ \qmlmethod font Qt::font(object fontSpecifier)
+
+ Returns a font with the properties specified in the \a fontSpecifier object
+ or the nearest matching font. The \a fontSpecifier object should contain
+ key-value pairs where valid keys are the \l{fontbasictypedocs}{font} type's
+ subproperty names, and the values are valid values for each subproperty.
+ Invalid keys will be ignored.
*/
ReturnedValue QtObject::method_font(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -445,8 +448,9 @@ ReturnedValue QtObject::method_font(const FunctionObject *b, const Value *, cons
/*!
-\qmlmethod Qt::vector2d(real x, real y)
-Returns a Vector2D with the specified \c x and \c y.
+ \qmlmethod vector2d Qt::vector2d(real x, real y)
+
+ Returns a vector2d with the specified \a x and \a y values.
*/
ReturnedValue QtObject::method_vector2d(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -463,8 +467,9 @@ ReturnedValue QtObject::method_vector2d(const FunctionObject *b, const Value *,
}
/*!
-\qmlmethod Qt::vector3d(real x, real y, real z)
-Returns a Vector3D with the specified \c x, \c y and \c z.
+ \qmlmethod vector3d Qt::vector3d(real x, real y, real z)
+
+ Returns a vector3d with the specified \a x, \a y, and \a z values.
*/
ReturnedValue QtObject::method_vector3d(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -482,8 +487,9 @@ ReturnedValue QtObject::method_vector3d(const FunctionObject *b, const Value *,
}
/*!
-\qmlmethod Qt::vector4d(real x, real y, real z, real w)
-Returns a Vector4D with the specified \c x, \c y, \c z and \c w.
+ \qmlmethod vector4d Qt::vector4d(real x, real y, real z, real w)
+
+ Returns a vector4d with the specified \a x, \a y, \a z, and \a w values.
*/
ReturnedValue QtObject::method_vector4d(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -502,8 +508,9 @@ ReturnedValue QtObject::method_vector4d(const FunctionObject *b, const Value *,
}
/*!
-\qmlmethod Qt::quaternion(real scalar, real x, real y, real z)
-Returns a Quaternion with the specified \c scalar, \c x, \c y, and \c z.
+ \qmlmethod quaternion Qt::quaternion(real scalar, real x, real y, real z)
+
+ Returns a quaternion with the specified \a scalar, \a x, \a y, and \a z values.
*/
ReturnedValue QtObject::method_quaternion(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -522,13 +529,25 @@ ReturnedValue QtObject::method_quaternion(const FunctionObject *b, const Value *
}
/*!
-\qmlmethod Qt::matrix4x4(real m11, real m12, real m13, real m14, real m21, real m22, real m23, real m24, real m31, real m32, real m33, real m34, real m41, real m42, real m43, real m44)
-Returns a Matrix4x4 with the specified values.
-Alternatively, the function may be called with a single argument
-where that argument is a JavaScript array which contains the sixteen
-matrix values.
-Finally, the function may be called with no arguments and the resulting
-matrix will be the identity matrix.
+ \qmlmethod matrix4x4 Qt::matrix4x4(real m11, real m12, real m13, real m14, real m21, real m22, real m23, real m24, real m31, real m32, real m33, real m34, real m41, real m42, real m43, real m44)
+
+ Returns a matrix4x4 with the specified values.
+
+ The arguments correspond to their positions in the matrix:
+
+ \table
+ \row \li \a m11 \li \a m12 \li \a m13 \li \a m14
+ \row \li \a m21 \li \a m22 \li \a m23 \li \a m24
+ \row \li \a m31 \li \a m32 \li \a m33 \li \a m34
+ \row \li \a m41 \li \a m42 \li \a m43 \li \a m44
+ \endtable
+
+ Alternatively, the function may be called with a single argument
+ where that argument is a JavaScript array which contains the sixteen
+ matrix values.
+
+ Finally, the function may be called with no arguments and the resulting
+ matrix will be the identity matrix.
*/
ReturnedValue QtObject::method_matrix4x4(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -572,18 +591,19 @@ ReturnedValue QtObject::method_matrix4x4(const FunctionObject *b, const Value *,
}
/*!
-\qmlmethod color Qt::lighter(color baseColor, real factor)
-Returns a color lighter than \c baseColor by the \c factor provided.
+ \qmlmethod color Qt::lighter(color baseColor, real factor)
+
+ Returns a color lighter than \a baseColor by the \a factor provided.
-If the factor is greater than 1.0, this functions returns a lighter color.
-Setting factor to 1.5 returns a color that is 50% brighter. If the factor is less than 1.0,
-the return color is darker, but we recommend using the Qt.darker() function for this purpose.
-If the factor is 0 or negative, the return value is unspecified.
+ If the factor is greater than 1.0, this functions returns a lighter color.
+ Setting factor to 1.5 returns a color that is 50% brighter. If the factor is less than 1.0,
+ the return color is darker, but we recommend using the Qt.darker() function for this purpose.
+ If the factor is 0 or negative, the return value is unspecified.
-The function converts the current RGB color to HSV, multiplies the value (V) component
-by factor and converts the color back to RGB.
+ The function converts the current RGB color to HSV, multiplies the value (V) component
+ by factor and converts the color back to RGB.
-If \c factor is not supplied, returns a color 50% lighter than \c baseColor (factor 1.5).
+ If \a factor is not supplied, returns a color that is 50% lighter than \a baseColor (factor 1.5).
*/
ReturnedValue QtObject::method_lighter(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -610,19 +630,20 @@ ReturnedValue QtObject::method_lighter(const FunctionObject *b, const Value *, c
}
/*!
-\qmlmethod color Qt::darker(color baseColor, real factor)
-Returns a color darker than \c baseColor by the \c factor provided.
+ \qmlmethod color Qt::darker(color baseColor, real factor)
-If the factor is greater than 1.0, this function returns a darker color.
-Setting factor to 3.0 returns a color that has one-third the brightness.
-If the factor is less than 1.0, the return color is lighter, but we recommend using
-the Qt.lighter() function for this purpose. If the factor is 0 or negative, the return
-value is unspecified.
+ Returns a color darker than \a baseColor by the \a factor provided.
-The function converts the current RGB color to HSV, divides the value (V) component
-by factor and converts the color back to RGB.
+ If the factor is greater than 1.0, this function returns a darker color.
+ Setting factor to 3.0 returns a color that has one-third the brightness.
+ If the factor is less than 1.0, the return color is lighter, but we recommend using
+ the Qt.lighter() function for this purpose. If the factor is 0 or negative, the return
+ value is unspecified.
-If \c factor is not supplied, returns a color 50% darker than \c baseColor (factor 2.0).
+ The function converts the current RGB color to HSV, divides the value (V) component
+ by factor and converts the color back to RGB.
+
+ If \a factor is not supplied, returns a color that is 50% darker than \a baseColor (factor 2.0).
*/
ReturnedValue QtObject::method_darker(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -650,7 +671,8 @@ ReturnedValue QtObject::method_darker(const FunctionObject *b, const Value *, co
/*!
\qmlmethod color Qt::tint(color baseColor, color tintColor)
- This function allows tinting one color with another.
+
+ This function allows tinting one color (\a baseColor) with another (\a tintColor).
The tint color should usually be mostly transparent, or you will not be
able to see the underlying color. The below example provides a slight red
@@ -670,7 +692,8 @@ ReturnedValue QtObject::method_darker(const FunctionObject *b, const Value *, co
\endqml
\image declarative-rect_tint.png
- Tint is most useful when a subtle change is intended to be conveyed due to some event; you can then use tinting to more effectively tune the visible color.
+ Tint is most useful when a subtle change is intended to be conveyed due to some event;
+ you can then use tinting to more effectively tune the visible color.
*/
ReturnedValue QtObject::method_tint(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -708,8 +731,8 @@ ReturnedValue QtObject::method_tint(const FunctionObject *b, const Value *, cons
/*!
\qmlmethod string Qt::formatDate(datetime date, variant format)
-Returns a string representation of \c date, optionally formatted according
-to \c format.
+Returns a string representation of \a date, optionally formatted according
+to \a format.
The \a date parameter may be a JavaScript \c Date object, a \l{date}{date}
property, a QDate, or QDateTime value. The \a format parameter may be any of
@@ -752,8 +775,8 @@ ReturnedValue QtObject::method_formatDate(const FunctionObject *b, const Value *
/*!
\qmlmethod string Qt::formatTime(datetime time, variant format)
-Returns a string representation of \c time, optionally formatted according to
-\c format.
+Returns a string representation of \a time, optionally formatted according to
+\a format.
The \a time parameter may be a JavaScript \c Date object, a QTime, or QDateTime
value. The \a format parameter may be any of the possible format values as
@@ -801,10 +824,10 @@ ReturnedValue QtObject::method_formatTime(const FunctionObject *b, const Value *
/*!
\qmlmethod string Qt::formatDateTime(datetime dateTime, variant format)
-Returns a string representation of \c datetime, optionally formatted according to
-\c format.
+Returns a string representation of \a dateTime, optionally formatted according to
+\a format.
-The \a date parameter may be a JavaScript \c Date object, a \l{date}{date}
+The \a dateTime parameter may be a JavaScript \c Date object, a \l{date}{date}
property, a QDate, QTime, or QDateTime value.
If \a format is not provided, \a dateTime is formatted using
@@ -921,8 +944,8 @@ ReturnedValue QtObject::method_formatDateTime(const FunctionObject *b, const Val
/*!
\qmlmethod bool Qt::openUrlExternally(url target)
- Attempts to open the specified \c target url in an external application, based on the user's
- desktop preferences. Returns true if it succeeds, and false otherwise.
+ Attempts to open the specified \a target url in an external application, based on the user's
+ desktop preferences. Returns \c true if it succeeds, \c false otherwise.
\warning A return value of \c true indicates that the application has successfully requested
the operating system to open the URL in an external application. The external application may
@@ -942,6 +965,7 @@ ReturnedValue QtObject::method_openUrlExternally(const FunctionObject *b, const
/*!
\qmlmethod url Qt::resolvedUrl(url url)
+
Returns \a url resolved relative to the URL of the caller.
*/
ReturnedValue QtObject::method_resolvedUrl(const FunctionObject *b, const Value *, const Value *argv, int argc)
@@ -967,6 +991,7 @@ ReturnedValue QtObject::method_resolvedUrl(const FunctionObject *b, const Value
/*!
\qmlmethod list<string> Qt::fontFamilies()
+
Returns a list of the font families available to the application.
*/
ReturnedValue QtObject::method_fontFamilies(const FunctionObject *b, const Value *, const Value *, int argc)
@@ -980,7 +1005,7 @@ ReturnedValue QtObject::method_fontFamilies(const FunctionObject *b, const Value
/*!
\qmlmethod string Qt::md5(data)
-Returns a hex string of the md5 hash of \c data.
+Returns a hex string of the md5 hash of \a data.
*/
ReturnedValue QtObject::method_md5(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -995,7 +1020,7 @@ ReturnedValue QtObject::method_md5(const FunctionObject *b, const Value *, const
/*!
\qmlmethod string Qt::btoa(data)
-Binary to ASCII - this function returns a base64 encoding of \c data.
+Binary to ASCII - this function returns a base64 encoding of \a data.
*/
ReturnedValue QtObject::method_btoa(const FunctionObject *b, const Value *, const Value *argv, int argc)
{
@@ -1043,9 +1068,9 @@ ReturnedValue QtObject::method_quit(const FunctionObject *b, const Value *, cons
This function causes the QQmlEngine::exit(int) signal to be emitted.
Within the \l {Prototyping with qmlscene}, this causes the launcher application to exit
- the specified return code. To exit from the event loop with a specified return code when this
- method is called, a C++ application can connect the QQmlEngine::exit(int) signal
- to the QCoreApplication::exit(int) slot.
+ the specified return code (\a retCode). To exit from the event loop with a specified
+ return code when this method is called, a C++ application can connect the
+ QQmlEngine::exit(int) signal to the QCoreApplication::exit(int) slot.
\sa quit()
*/
@@ -1318,13 +1343,13 @@ ReturnedValue QtObject::method_createComponent(const FunctionObject *b, const Va
\qmlmethod Qt::locale(name)
Returns a JS object representing the locale with the specified
- name, which has the format "language[_territory][.codeset][@modifier]"
+ \a name, which has the format "language[_territory][.codeset][@modifier]"
or "C", where:
\list
- \li language is a lowercase, two-letter, ISO 639 language code,
- \li territory is an uppercase, two-letter, ISO 3166 country code,
- \li and codeset and modifier are ignored.
+ \li \c language is a lowercase, two-letter, ISO 639 language code,
+ \li \c territory is an uppercase, two-letter, ISO 3166 country code, and
+ \li \c codeset and \c modifier are ignored.
\endlist
If the string violates the locale format, or language is not a
@@ -1372,7 +1397,8 @@ DEFINE_OBJECT_VTABLE(QQmlBindingFunction);
/*!
\qmlmethod Qt::binding(function)
- Returns a JavaScript object representing a \l{Property Binding}{property binding}.
+ Returns a JavaScript object representing a \l{Property Binding}{property binding},
+ with a \a function that evaluates the binding.
There are two main use-cases for the function: firstly, to apply a
property binding imperatively from JavaScript code: