aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8
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/v8
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/v8')
-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
4 files changed, 16 insertions, 16 deletions
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