aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-05-14 12:41:32 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-15 09:32:58 +0200
commitebbb0257e65b762ac6c3cf2baa19bbb5d581d071 (patch)
tree57f4b9df9881043b34a57e0718c9d28a0e7ba3f7 /src/qml
parent56da72fb219356d2948e9adae3f3a17553fc7add (diff)
Doc: Define Qt global object as a QML type and fix referring docs
This change adds the Qt global object as a QML type in the Qt QML module and fixes links to it in documentation. Task-number: QTBUG-29353 Change-Id: I1690224091a79a3309fac7a78aa0c0c734449e4f Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/doc/src/cppclasses/topic.qdoc2
-rw-r--r--src/qml/doc/src/cppintegration/contextproperties.qdoc2
-rw-r--r--src/qml/doc/src/cppintegration/data.qdoc2
-rw-r--r--src/qml/doc/src/javascript/dynamicobjectcreation.qdoc16
-rw-r--r--src/qml/doc/src/javascript/imports.qdoc6
-rw-r--r--src/qml/doc/src/qmltypereference.qdoc10
-rw-r--r--src/qml/doc/src/whatsnew.qdoc2
-rw-r--r--src/qml/qml/qqmlcomponent.cpp2
-rw-r--r--src/qml/qml/qqmlengine.cpp5
-rw-r--r--src/qml/qml/qqmllocale.cpp4
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp10
11 files changed, 31 insertions, 30 deletions
diff --git a/src/qml/doc/src/cppclasses/topic.qdoc b/src/qml/doc/src/cppclasses/topic.qdoc
index 66a374e811..7c21793cfd 100644
--- a/src/qml/doc/src/cppclasses/topic.qdoc
+++ b/src/qml/doc/src/cppclasses/topic.qdoc
@@ -88,7 +88,7 @@ properties of a QQmlContext, and how to access the context for an object.
Dynamic object instantiation and dynamic expression evaluation are both core
concepts in QML. QML documents define object types which can be instantiated
at run-time using a QQmlComponent. An instance of the QQmlComponent class can
-be created in C++ directly, or via the \l{QML:Qt::createComponent()}
+be created in C++ directly, or via the \l{QtQml2::Qt::createComponent()}
{Qt.createComponent()} function in imperative QML code. Arbitrary expressions
can be calculated in C++ via the QQmlExpression class, and such expressions
can interact directly the QML context.
diff --git a/src/qml/doc/src/cppintegration/contextproperties.qdoc b/src/qml/doc/src/cppintegration/contextproperties.qdoc
index aaac43e470..1c2bced738 100644
--- a/src/qml/doc/src/cppintegration/contextproperties.qdoc
+++ b/src/qml/doc/src/cppintegration/contextproperties.qdoc
@@ -74,7 +74,7 @@ QML code invokes a method on the object instance:
\endtable
(Note that date/time values returned from C++ to QML can be formatted through
-\l{QML:Qt::formatDateTime}{Qt.formatDateTime()} and associated functions.)
+\l{QtQml2::Qt::formatDateTime}{Qt.formatDateTime()} and associated functions.)
If the QML item needs to receive signals from the context property, it can connect to them using the
\l Connections type. For example, if \c ApplicationData has a signal named \c
diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc
index dc1b4cae9c..74a93436f5 100644
--- a/src/qml/doc/src/cppintegration/data.qdoc
+++ b/src/qml/doc/src/cppintegration/data.qdoc
@@ -124,7 +124,7 @@ QQuaternion and QMatrix4x4, are only available from QML when the \l {Qt Quick}
module is included.
As a convenience, many of these types can be specified in QML by string values,
-or by a related method provided by the \l {QML:Qt} object. For example, the \l
+or by a related method provided by the \l {QtQml2::Qt} object. For example, the \l
{Image::sourceSize} property is of type \l size (which automatically translates
to the QSize type) and can be specified by a string value formatted as
"width\c{x}height", or by the Qt.size() function:
diff --git a/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc b/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
index 421b180f7b..8020f0371e 100644
--- a/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
+++ b/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
@@ -42,8 +42,8 @@ demonstration of the concepts discussed on this page.
\section1 Creating Objects Dynamically
There are two ways to create objects dynamically from JavaScript. You can
-either call \l {QML:Qt::createComponent()}{Qt.createComponent()} to
-dynamically create a \l Component object, or use \l{QML:Qt::createQmlObject()}
+either call \l {QtQml2::Qt::createComponent()}{Qt.createComponent()} to
+dynamically create a \l Component object, or use \l{QtQml2::Qt::createQmlObject()}
{Qt.createQmlObject()} to create an object from a string of QML. Creating a
component is better if you have an existing component defined in a QML document
and you want to dynamically create instances of that component. Otherwise,
@@ -54,7 +54,7 @@ generated at runtime.
\section2 Creating a Component Dynamically
To dynamically load a component defined in a QML file, call the
-\l {QML:Qt::createComponent()}{Qt.createComponent()} function in the
+\l {QtQml2::Qt::createComponent()}{Qt.createComponent()} function in the
\l {QmlGlobalQtObject}{Qt object}.
This function takes the URL of the QML file as its only argument and creates
a \l Component object from this URL.
@@ -113,7 +113,7 @@ created object is a visual (Qt Quick) object. The created object will become a
child of the \c appWindow object in \c main.qml, and appear in the scene.
When using files with relative paths, the path should
-be relative to the file where \l {QML:Qt::createComponent()}
+be relative to the file where \l {QtQml2::Qt::createComponent()}
{Qt.createComponent()} is executed.
To connect signals to (or receive signals from) dynamically created objects,
@@ -127,7 +127,7 @@ It is also possible to instantiate components without blocking via the
\section2 Creating an Object from a String of QML
If the QML is not defined until runtime, you can create a QML object from
-a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+a string of QML using the \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()}
function, as in the following example:
\snippet qml/createQmlObject.qml 0
@@ -153,9 +153,9 @@ first, the bindings in the dynamic object will no longer work.
The actual creation context depends on how an object is created:
\list
-\li If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the
+\li If \l {QtQml2::Qt::createComponent()}{Qt.createComponent()} is used, the
creation context is the QQmlContext in which this method is called
-\li If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} is called, the
+\li If \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()} is called, the
creation context is the context of the parent object passed to this method
\li If a \c {Component{}} object is defined and \l {Component::createObject()}
{createObject()} or \l {Component::incubateObject()}{incubateObject()} is
@@ -221,7 +221,7 @@ Item {
This would result in an error, since objects can only be dynamically
destroyed if they were dynamically created.
-Objects created with \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+Objects created with \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()}
can similarly be destroyed using \c destroy():
\snippet qml/createQmlObject.qml 0
diff --git a/src/qml/doc/src/javascript/imports.qdoc b/src/qml/doc/src/javascript/imports.qdoc
index f4d7f7dc08..809b74ed52 100644
--- a/src/qml/doc/src/javascript/imports.qdoc
+++ b/src/qml/doc/src/javascript/imports.qdoc
@@ -125,14 +125,14 @@ When a JavaScript file is imported, it must be imported with a qualifier. The
functions in that file are then accessible from the importing script via the
qualifier (that is, as \tt{Qualifier.functionName(params)}). Sometimes it is
desirable to have the functions made available in the importing context without
-needing to qualify them, and in this circumstance the \l{QML:Qt::include()}
+needing to qualify them, and in this circumstance the \l{QtQml2::Qt::include()}
{Qt.include()} function may be used to include one JavaScript file from another.
This copies all functions from the other file into the current file's
namespace, but ignores all pragmas and imports defined in that file.
For example, the QML code below left calls \c showCalculations() in \c script.js,
which in turn can call \c factorial() in \c factorial.js, as it has included
-\c factorial.js using \l {QML:Qt::include()}{Qt.include()}.
+\c factorial.js using \l {QtQml2::Qt::include()}{Qt.include()}.
\table
\row
@@ -142,7 +142,7 @@ which in turn can call \c factorial() in \c factorial.js, as it has included
\li \snippet qml/integrating-javascript/includejs/factorial.js 0
\endtable
-Notice that calling \l {QML:Qt::include()}{Qt.include()} copies all functions
+Notice that calling \l {QtQml2::Qt::include()}{Qt.include()} copies all functions
from \c factorial.js into the \c MyScript namespace, which means the QML
component can also access \c factorial() directly as \c MyScript.factorial().
diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc
index 54e10b63a8..f0aadbaf32 100644
--- a/src/qml/doc/src/qmltypereference.qdoc
+++ b/src/qml/doc/src/qmltypereference.qdoc
@@ -93,7 +93,7 @@ MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
\endqml
To read a date value returned from a C++ extension class, use
-\l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatDate()}{Qt.formatDate()} and \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
When integrating with C++, note that any QDate value
\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
@@ -124,7 +124,7 @@ MyTimePicker { time: "14:22:15" }
\endqml
To read a time value returned from a C++ extension class, use
-\l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatTime()}{Qt.formatTime()} and \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
Note that when converting historical times to and from javascript that QDateTime and the JS Date object
have different methods of calculating historical daylight savings time application. This can lead to variations of one hour
@@ -153,7 +153,7 @@ To create a \c point value, specify it as a "x,y" string:
CustomObject { myPointProperty: "0,20" }
\endqml
-Or use the \l{QML:Qt::point()}{Qt.point()} function:
+Or use the \l{QtQml2::Qt::point()}{Qt.point()} function:
\qml
CustomObject { myPointProperty: Qt.point(0, 20) }
@@ -191,7 +191,7 @@ To create a \c size value, specify it as a "width x height" string:
Image { sourceSize: "150x50" }
\endqml
-Or use the \l{QML:Qt::size()}{Qt.size()} function:
+Or use the \l{QtQml2::Qt::size()}{Qt.size()} function:
\qml
Image { sourceSize: Qt.size(150, 50) }
@@ -231,7 +231,7 @@ To create a \c rect value, specify it as a "x, y, width x height" string:
CustomObject { myRectProperty: "50,50,100x100" }
\endqml
-Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
+Or use the \l{QtQml2::Qt::rect()}{Qt.rect()} function:
\qml
CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc
index 154c7cfd0d..6ca979db37 100644
--- a/src/qml/doc/src/whatsnew.qdoc
+++ b/src/qml/doc/src/whatsnew.qdoc
@@ -94,7 +94,7 @@ has now been replaced by the new \l {Qt QML} and \l {Qt Quick} modules. See the
\list
\li QQmlExpression can now be constructed directly (and more efficiently) from a QQmlScriptString.
-\li The \l {QML:Qt} object now provides a \l{QML:Qt::inputMethod} property to access the active
+\li The \l {QtQml2::Qt}{Qt} global object now provides an \l{QtQml2::Qt::inputMethod}{inputMethod} property to access the active
text input method for an application.
\endlist
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 7cf7c5475e..73f778e86a 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -229,7 +229,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
to specify how each list item is to be displayed.
\c Component objects can also be created dynamically using
- \l{QML:Qt::createComponent()}{Qt.createComponent()}.
+ \l{QtQml2::Qt::createComponent()}{Qt.createComponent()}.
\section2 Creation Context
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 34ebe0a9e2..377d0c49d6 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -275,8 +275,9 @@ QQmlImageProviderBase::~QQmlImageProviderBase()
/*!
\qmltype Qt
- \instantiates QQmlEnginePrivate
- \ingroup qml-utility-elements
+\inqmlmodule QtQml 2
+\instantiates QQmlEnginePrivate
+\ingroup qml-utility-elements
\brief The QML global Qt object provides useful enums and functions from Qt.
\keyword QmlGlobalQtObject
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index 15ddcc7c29..194a5ca7e7 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -772,10 +772,10 @@ V8_DEFINE_EXTENSION(QV8LocaleDataDeletable, localeV8Data);
\inqmlmodule QtQml 2
\brief Provides locale specific properties and formatted data
- The Locale object may only be created via the \l{QML:Qt::locale()}{Qt.locale()} function.
+ The Locale object may only be created via the \l{QtQml2::Qt::locale()}{Qt.locale()} function.
It cannot be created directly.
- The \l{QML:Qt::locale()}{Qt.locale()} function returns a JS Locale object representing the
+ The \l{QtQml2::Qt::locale()}{Qt.locale()} function returns a JS Locale object representing the
locale with the specified name, which has the format
"language[_territory][.codeset][@modifier]" or "C".
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index b5f4bf555c..29dba5f4b7 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -821,7 +821,7 @@ to \c 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
the possible format values as described for
-\l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
If \a format is not specified, \a date is formatted using
\l {Qt::DefaultLocaleShortDate}{Qt.DefaultLocaleShortDate}.
@@ -862,7 +862,7 @@ Returns a string representation of \c time, optionally formatted according to
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
-described for \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+described for \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
If \a format is not specified, \a time is formatted using
\l {Qt::DefaultLocaleShortDate}{Qt.DefaultLocaleShortDate}.
@@ -978,7 +978,7 @@ For example, if the following date/time value was specified:
\endcode
This \a dateTime value could be passed to \c Qt.formatDateTime(),
-\l {QML:Qt::formatDate()}{Qt.formatDate()} or \l {QML:Qt::formatTime()}{Qt.formatTime()}
+\l {QtQml2::Qt::formatDate()}{Qt.formatDate()} or \l {QtQml2::Qt::formatTime()}{Qt.formatTime()}
with the \a format values below to produce the following results:
\table
@@ -1138,7 +1138,7 @@ For example, if the above snippet had misspelled color as 'colro' then the array
Note that this function returns immediately, and therefore may not work if
the \a qml string loads new components (that is, external QML files that have not yet been loaded).
-If this is the case, consider using \l{QML:Qt::createComponent()}{Qt.createComponent()} instead.
+If this is the case, consider using \l{QtQml2::Qt::createComponent()}{Qt.createComponent()} instead.
See \l {Dynamic QML Object Creation from JavaScript} for more information on using this function.
*/
@@ -1264,7 +1264,7 @@ For example:
See \l {Dynamic QML Object Creation from JavaScript} for more information on using this function.
To create a QML object from an arbitrary string of QML (instead of a file),
-use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
+use \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()}.
*/
v8::Handle<v8::Value> createComponent(const v8::Arguments &args)
{