aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2012-05-28 11:56:24 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-31 10:40:41 +0200
commit4c671c046e8140bfb8372aab2c38aabe82b102b0 (patch)
tree7a70a75a553dcc806372a6b43ea39da05191db8a /src/qml/qml
parent0c7669b241aae96fca97acae0b628e627d5bfc4e (diff)
Fix doc snippets paths and parsing errors
qtqml.qdocconf and qtquick.qdocconf now refer to the correct snippets and source directories. Snippet paths in .qdoc and .cpp files have been updated to refer to the new shortened path references, e.g. \snippet qml/file.cpp instead of \snippet doc/src/snippets/qml/file.cpp. This also deletes snippets from src/qml/doc/snippets that belonged under src/quick/doc/snippets (and were already duplicated there anyway) and restores some snippet files that shouldn't have been deleted. Also fixes some inline snippets to use \code .. \endcode instead of \qml .. \endqml as they contained javascript or partial QML snippets that were causing parsing errors from qdoc. There are still snippet errors arising from qmlintro.qdoc as the qmlintro snippets directory that it refers to cannot be located. There are also two references to a removed snippet identifier in examples/qml/cppextensions/plugins/plugin.cpp that need to be fixed in conjunction with the related docs in a later commit as the relevant code has changed and the docs are now invalid. Task-number: QTBUG-25721 Change-Id: I50c665245a74c140470c58a32546591d187dfe4b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/ftw/qintrusivelist.cpp2
-rw-r--r--src/qml/qml/qqmlcomponent.cpp2
-rw-r--r--src/qml/qml/qqmlengine.cpp4
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp4
-rw-r--r--src/qml/qml/qquicklistmodel.cpp20
-rw-r--r--src/qml/qml/qquickworkerscript.cpp4
-rw-r--r--src/qml/qml/v8/qjsengine.cpp12
-rw-r--r--src/qml/qml/v8/qjsvalue.cpp2
-rw-r--r--src/qml/qml/v8/qjsvalueiterator.cpp4
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp14
10 files changed, 34 insertions, 34 deletions
diff --git a/src/qml/qml/ftw/qintrusivelist.cpp b/src/qml/qml/ftw/qintrusivelist.cpp
index 5a1624f1f4..4a4b131c9c 100644
--- a/src/qml/qml/ftw/qintrusivelist.cpp
+++ b/src/qml/qml/ftw/qintrusivelist.cpp
@@ -147,7 +147,7 @@ Returns an STL-style iterator pointing to the imaginary item after the last item
*/
/*!
-iterator &QInplacelist::iterator::erase()
+\fn iterator &QInplacelist::iterator::erase()
Remove the current object from the list, and return an iterator to the next element.
*/
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 1ade6988f7..d31b4d4773 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -205,7 +205,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
For example, here is a component that is used by multiple \l Loader objects.
It contains a single item, a \l Rectangle:
- \snippet doc/snippets/qml/component.qml 0
+ \snippet qml/component.qml 0
Notice that while a \l Rectangle by itself would be automatically
rendered and displayed, this is not the case for the above rectangle
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index beaa6d78dc..6b1c869ee8 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -120,7 +120,7 @@ void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor)
It can be useful to create a QtObject if you need an extremely
lightweight element to enclose a set of custom properties:
- \snippet doc/snippets/qml/qtobject.qml 0
+ \snippet qml/qtobject.qml 0
It can also be useful for C++ integration, as it is just a plain
QObject. See the QObject documentation for further details.
@@ -360,7 +360,7 @@ The following functions are also on the Qt object.
The following example uses the \c application object to indicate
whether the application is currently active:
- \snippet doc/snippets/qml/application.qml document
+ \snippet qml/application.qml document
*/
/*!
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index 73d74f9e21..667e50a6bf 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -110,12 +110,12 @@ QT_BEGIN_NAMESPACE
should be bundled with the plugin, so it needs to be specified in the \c qmldir
file:
- \quotefile examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
+ \quotefile examples/qml/cppextensions/plugins/com/nokia/TimeExample/qmldir
Once the project is built and installed, the new \c Time element can be
used by any QML component that imports the \c com.nokia.TimeExample module:
- \snippet examples/declarative/cppextensions/plugins/plugins.qml 0
+ \snippet examples/qml/cppextensions/plugins/plugins.qml 0
The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}.
diff --git a/src/qml/qml/qquicklistmodel.cpp b/src/qml/qml/qquicklistmodel.cpp
index 389394652a..8e1155bae8 100644
--- a/src/qml/qml/qquicklistmodel.cpp
+++ b/src/qml/qml/qquicklistmodel.cpp
@@ -1380,7 +1380,7 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
\inlineimage listmodel.png
\enddiv
- \snippet doc/snippets/qml/listmodel.qml 0
+ \snippet qml/listmodel/listmodel.qml 0
Roles (properties) in each element must begin with a lower-case letter and
should be common to all elements in a model. The ListElement documentation
@@ -1389,14 +1389,14 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
Since the example model contains an \c id property, it can be referenced
by views, such as the ListView in this example:
- \snippet doc/snippets/qml/listmodel-simple.qml 0
+ \snippet qml/listmodel/listmodel-simple.qml 0
\dots 8
- \snippet doc/snippets/qml/listmodel-simple.qml 1
+ \snippet qml/listmodel/listmodel-simple.qml 1
It is possible for roles to contain list data. In the following example we
create a list of fruit attributes:
- \snippet doc/snippets/qml/listmodel-nested.qml model
+ \snippet qml/listmodel/listmodel-nested.qml model
The delegate displays all the fruit attributes:
@@ -1404,14 +1404,14 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
\inlineimage listmodel-nested.png
\enddiv
- \snippet doc/snippets/qml/listmodel-nested.qml delegate
+ \snippet qml/listmodel/listmodel-nested.qml delegate
\section1 Modifying List Models
The content of a ListModel may be created and modified using the clear(),
append(), set(), insert() and setProperty() methods. For example:
- \snippet doc/snippets/qml/listmodel-modify.qml delegate
+ \snippet qml/listmodel/listmodel-modify.qml delegate
Note that when creating content dynamically the set of available properties
cannot be changed once set. Whatever properties are first added to the model
@@ -1427,11 +1427,11 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
Here is an example that uses WorkerScript to periodically append the
current time to a list model:
- \snippet examples/declarative/threading/threadedlistmodel/timedisplay.qml 0
+ \snippet examples/quick/threading/threadedlistmodel/timedisplay.qml 0
The included file, \tt dataloader.js, looks like this:
- \snippet examples/declarative/threading/threadedlistmodel/dataloader.js 0
+ \snippet examples/quick/threading/threadedlistmodel/dataloader.js 0
The timer in the main example sends messages to the worker script by calling
\l WorkerScript::sendMessage(). When this message is received,
@@ -2456,12 +2456,12 @@ bool QQuickListModelParser::definesEmptyList(const QString &s)
The following model defines a series of list elements, each of which
contain "name" and "cost" roles and their associated values.
- \snippet doc/snippets/qml/qml-data-models/listelements.qml model
+ \snippet qml/listmodel/listelements.qml model
The delegate obtains the name and cost for each element by simply referring
to \c name and \c cost:
- \snippet doc/snippets/qml/qml-data-models/listelements.qml view
+ \snippet qml/listmodel/listelements.qml view
\sa ListModel
*/
diff --git a/src/qml/qml/qquickworkerscript.cpp b/src/qml/qml/qquickworkerscript.cpp
index 81ebb1fed4..53eb60eab3 100644
--- a/src/qml/qml/qquickworkerscript.cpp
+++ b/src/qml/qml/qquickworkerscript.cpp
@@ -574,12 +574,12 @@ void QQuickWorkerScriptEngine::run()
An example:
- \snippet doc/snippets/qml/workerscript.qml 0
+ \snippet qml/workerscript/workerscript.qml 0
The above worker script specifies a JavaScript file, "script.js", that handles
the operations to be performed in the new thread. Here is \c script.js:
- \quotefile doc/src/snippets/qml/script.js
+ \quotefile qml/workerscript/script.js
When the user clicks anywhere within the rectangle, \c sendMessage() is
called, triggering the \tt WorkerScript.onMessage() handler in
diff --git a/src/qml/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp
index 03cd51eab9..080540eeef 100644
--- a/src/qml/qml/v8/qjsengine.cpp
+++ b/src/qml/qml/v8/qjsengine.cpp
@@ -84,7 +84,7 @@ Q_DECLARE_METATYPE(QList<int>)
Use evaluate() to evaluate script code.
- \snippet doc/snippets/code/src_script_qjsengine.cpp 0
+ \snippet code/src_script_qjsengine.cpp 0
evaluate() returns a QJSValue that holds the result of the
evaluation. The QJSValue class provides functions for converting
@@ -94,13 +94,13 @@ Q_DECLARE_METATYPE(QList<int>)
The following code snippet shows how a script function can be
defined and then invoked from C++ using QJSValue::call():
- \snippet doc/snippets/code/src_script_qjsengine.cpp 1
+ \snippet code/src_script_qjsengine.cpp 1
As can be seen from the above snippets, a script is provided to the
engine in the form of a string. One common way of loading scripts is
by reading the contents of a file and passing it to evaluate():
- \snippet doc/snippets/code/src_script_qjsengine.cpp 2
+ \snippet code/src_script_qjsengine.cpp 2
Here we pass the name of the file as the second argument to
evaluate(). This does not affect evaluation in any way; the second
@@ -116,7 +116,7 @@ Q_DECLARE_METATYPE(QList<int>)
want to configure a script engine by adding one or more properties
to the Global Object:
- \snippet doc/snippets/code/src_script_qjsengine.cpp 3
+ \snippet code/src_script_qjsengine.cpp 3
Adding custom properties to the scripting environment is one of the
standard means of providing a scripting API that is specific to your
@@ -132,7 +132,7 @@ Q_DECLARE_METATYPE(QList<int>)
value. If isError() returns true, you can call toString() on the
error object to obtain an error message.
- \snippet doc/snippets/code/src_script_qjsengine.cpp 4
+ \snippet code/src_script_qjsengine.cpp 4
\section1 Script Object Creation
@@ -150,7 +150,7 @@ Q_DECLARE_METATYPE(QList<int>)
properties of the proxy object. No binding code is needed because it
is done dynamically using the Qt meta object system.
- \snippet doc/snippets/code/src_script_qjsengine.cpp 5
+ \snippet code/src_script_qjsengine.cpp 5
\sa QJSValue, {Making Applications Scriptable}
diff --git a/src/qml/qml/v8/qjsvalue.cpp b/src/qml/qml/v8/qjsvalue.cpp
index 58732f2df8..514572ca71 100644
--- a/src/qml/qml/v8/qjsvalue.cpp
+++ b/src/qml/qml/v8/qjsvalue.cpp
@@ -77,7 +77,7 @@
QJSValues. Use setProperty() to set a property of an object, and
call property() to retrieve the value of a property.
- \snippet doc/snippets/code/src_script_qjsvalue.cpp 0
+ \snippet code/src_script_qjsvalue.cpp 0
If you want to iterate over the properties of a script object, use
the QJSValueIterator class.
diff --git a/src/qml/qml/v8/qjsvalueiterator.cpp b/src/qml/qml/v8/qjsvalueiterator.cpp
index 921d359f4e..6be892a40e 100644
--- a/src/qml/qml/v8/qjsvalueiterator.cpp
+++ b/src/qml/qml/v8/qjsvalueiterator.cpp
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
beginning of the sequence of properties. Here's how to iterate over
all the properties of a QJSValue:
- \snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 0
+ \snippet code/src_script_qjsvalueiterator.cpp 0
The next() advances the iterator. The name() and value()
functions return the name and value of the last item that was
@@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE
own properties; i.e. it does not follow the prototype chain. You can
use a loop like this to follow the prototype chain:
- \snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 1
+ \snippet code/src_script_qjsvalueiterator.cpp 1
\sa QJSValue::property()
*/
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index f6c7a5969d..787197d1d7 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -978,7 +978,7 @@ If \a filepath is specified, it will be used for error reporting for the created
Example (where \c parentItem is the id of an existing QML item):
-\snippet doc/snippets/qml/createQmlObject.qml 0
+\snippet qml/createQmlObject.qml 0
In the case of an error, a QtScript Error object is thrown. This object has an additional property,
\c qmlErrors, which is an array of the errors encountered.
@@ -1109,7 +1109,7 @@ component to create an object instance of the component.
For example:
-\snippet doc/snippets/qml/createComponent-simple.qml 0
+\snippet qml/createComponent-simple.qml 0
See \l {Dynamic Object Management in QML} for more information on using this function.
@@ -1329,20 +1329,20 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args)
There are two main use-cases for the function: firstly, in imperative
JavaScript code to cause a binding assignment:
- \snippet doc/snippets/declarative/qtBinding.1.qml 0
+ \snippet qml/qtBinding.1.qml 0
and secondly, when defining initial property values of dynamically
constructed objects (via Component.createObject() or
Loader.setSource()) as being bound to the result of an expression.
For example, assuming the existence of a DynamicText component:
- \snippet doc/snippets/declarative/DynamicText.qml 0
+ \snippet qml/DynamicText.qml 0
the output from:
- \snippet doc/snippets/declarative/qtBinding.2.qml 0
+ \snippet qml/qtBinding.2.qml 0
and from:
- \snippet doc/snippets/declarative/qtBinding.3.qml 0
+ \snippet qml/qtBinding.3.qml 0
should both be:
\code
@@ -1357,7 +1357,7 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args)
declarations and binding assignments}) except when the result is
stored in an array bound to a var property.
- \snippet doc/snippets/declarative/qtBinding.4.qml 0
+ \snippet qml/qtBinding.4.qml 0
Note: in QtQuick 1.x, all function assignment was treated as
binding assignment, so the Qt.binding() function is new in