diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/declarative/elements.qdoc | 7 | ||||
-rw-r--r-- | doc/src/declarative/extending-examples.qdoc | 5 | ||||
-rw-r--r-- | doc/src/declarative/extending.qdoc | 22 | ||||
-rw-r--r-- | doc/src/declarative/integrating.qdoc | 3 | ||||
-rw-r--r-- | doc/src/declarative/javascriptblocks.qdoc | 20 | ||||
-rw-r--r-- | doc/src/declarative/network.qdoc | 6 | ||||
-rw-r--r-- | doc/src/declarative/qtdeclarative.qdoc | 6 | ||||
-rw-r--r-- | doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h | 3 | ||||
-rw-r--r-- | doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h | 3 | ||||
-rwxr-xr-x | doc/src/template/style/style.css | 15 |
10 files changed, 35 insertions, 55 deletions
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index ce3a6e3..355c0f4 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -46,8 +46,6 @@ The following table lists the QML elements provided by the Qt Declarative module. -\bold {Standard Qt Declarative Elements} - \table 80% \header \o \bold {States} @@ -81,6 +79,7 @@ The following table lists the QML elements provided by the Qt Declarative module \o \l PropertyAction \o \l ScriptAction \o \l Transition +\o \l SmoothedFollow \o \l SpringFollow \o \l Behavior \endlist @@ -109,11 +108,7 @@ The following table lists the QML elements provided by the Qt Declarative module \o \l QtObject \o \l WorkerScript \endlist -\endtable -\bold {QML Items} - -\table 80% \header \o \bold {Basic Visual Items} \o \bold {Basic Interaction Items} diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc index cc66838..307162e 100644 --- a/doc/src/declarative/extending-examples.qdoc +++ b/doc/src/declarative/extending-examples.qdoc @@ -57,11 +57,6 @@ element, the C++ class can be named differently, or appear in a namespace. \snippet examples/declarative/extending/adding/person.h 0 -Following the class declaration, we include the QML_DECLARE_TYPE() macro. This -is necessary to declare the type to QML. It also includes the logic necessary -to expose the class to Qt's meta system - that is, it includes the -Q_DECLARE_METATYPE() functionality. - \section1 Define the Person class \snippet examples/declarative/extending/adding/person.cpp 0 diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index e1c6469..a1d8a10 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -67,12 +67,11 @@ that derive from QObject. The QML engine has no intrinsic knowledge of any class types. Instead the programmer must define the C++ types, and their corresponding QML name. -Custom C++ types are declared QML types using a macro and a template function: +Custom C++ types are registered using a template function: \quotation \code -#define QML_DECLARE_TYPE(T) template<typename T> int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) \endcode @@ -81,10 +80,6 @@ Calling qmlRegisterType() registers the C++ type \a T with the QML system, and m under the name \a qmlName in library \a uri version \a versionMajor.versionMinor. The \a qmlName can be the same as the C++ type name. -Generally the QML_DECLARE_TYPE() macro should be included immediately following -the type declaration (usually in its header file), and the template function qmlRegisterType() -called by the implementation. - Type \a T must be a concrete type that inherits QObject and has a default constructor. \endquotation @@ -149,21 +144,16 @@ property can be assigned. QML also supports assigning Qt interfaces. To assign to a property whose type is a Qt interface pointer, the interface must also be registered with QML. As they cannot be instantiated directly, registering a Qt interface is different -from registering a new QML type. The following macro and function are used instead: +from registering a new QML type. The following function is used instead: \quotation \code -#define QML_DECLARE_INTERFACE(T) template<typename T> int qmlRegisterInterface(const char *typeName) \endcode Registers the C++ interface \a T with the QML system as \a typeName. -Generally the QML_DECLARE_INTERFACE() macro should be included immediately -following the interface declaration (usually in its header file), and the -qmlRegisterInterface() template function called by the implementation. - Following registration, QML can coerce objects that implement this interface for assignment to appropriately typed properties. \endquotation @@ -198,11 +188,10 @@ To assign to a property, the property's type must have been registered with QML. Both the qmlRegisterType() and qmlRegisterInterface() template functions already shown can be used to register a type with QML. Additionally, if a type that acts purely as a base class that cannot be instantiated from QML needs to be -registered these macro and function can be used: +registered, the following function can be used: \quotation \code - #define QML_DECLARE_TYPE(T) template<typename T> int qmlRegisterType() \endcode @@ -212,10 +201,6 @@ function qmlRegisterType() does not define a mapping between the C++ class and a QML element name, so the type is not instantiable from QML, but it is available for type coercion. -Generally the QML_DECLARE_TYPE() macro should be included immediately following -the type declaration (usually in its header file), and the -qmlRegisterType() template function called from the implementation. - Type \a T must inherit QObject, but there are no restrictions on whether it is concrete or the signature of its constructor. \endquotation @@ -320,7 +305,6 @@ public: }; QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(MyType) \endcode Return an attachment object, of type \a AttachedPropertiesType, for the attachee \a object instance. It is customary, though not strictly required, for diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc index d4034fa..65413ec 100644 --- a/doc/src/declarative/integrating.qdoc +++ b/doc/src/declarative/integrating.qdoc @@ -115,8 +115,7 @@ any custom C++ types and create a plugin that registers the custom types so that they can be used from your QML file. Here is an example. Suppose you have two classes, \c RedSquare and \c BlueCircle, -that both inherit from QGraphicsWidget. First, you need to register these two types -using the \c QML_DECLARE_TYPE macro from \c <QtDeclarative/qdeclarative.h>, like this: +that both inherit from QGraphicsWidget: \c [graphicswidgets/redsquare.h] \snippet doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h 0 diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc index 8ffe58c..7c0570e 100644 --- a/doc/src/declarative/javascriptblocks.qdoc +++ b/doc/src/declarative/javascriptblocks.qdoc @@ -47,7 +47,7 @@ QML encourages building UIs declaratively, using \l {Property Binding} and the composition of existing \l {QML Elements}. To allow the implementation of more advanced behavior, QML integrates tightly with imperative JavaScript code. -The JavaScript environment provided by QML is stricter than that in a webbrowser. +The JavaScript environment provided by QML is stricter than that in a web browser. In QML you cannot add, or modify, members of the JavaScript global object. It is possible to do this accidentally by using a variable without declaring it. In QML this will throw an exception, so all local variables should be explicitly @@ -66,7 +66,7 @@ them. \code Item { function factorial(a) { - a = Integer(a); + a = parseInt(a); if (a <= 0) return 1; else @@ -104,12 +104,12 @@ Item { } \endcode -Both relative and absolute JavaScript URLs can be imported. In the case of a -relative URL, the location is resolved relative to the location of the -\l {QML Document} that contains the import. If the script file is not accessible, -an error will occur. If the JavaScript needs to be fetched from a network +Both relative and absolute JavaScript URLs can be imported. In the case of a +relative URL, the location is resolved relative to the location of the +\l {QML Document} that contains the import. If the script file is not accessible, +an error will occur. If the JavaScript needs to be fetched from a network resource, the QML document has a "Loading" -\l {QDeclarativeComponent::status()}{status} until the script has been +\l {QDeclarativeComponent::status()}{status} until the script has been downloaded. Imported JavaScript files are always qualified using the "as" keyword. The @@ -143,7 +143,7 @@ stateless library through the use of a pragma, as shown in the following example .pragma library function factorial(a) { - a = Integer(a); + a = parseInt(a); if (a <= 0) return 1; else @@ -160,7 +160,7 @@ parameters. \section1 Running JavaScript at Startup It is occasionally necessary to run some imperative code at application (or -component instance) "startup". While it is tempting to just include the startup +component instance) startup. While it is tempting to just include the startup script as \e {global code} in an external script file, this can have severe limitations as the QML environment may not have been fully established. For example, some objects might not have been created or some \l {Property Binding}s may not have been run. @@ -180,7 +180,7 @@ Rectangle { } \endcode -Any element in a QML file - including nested elements and nested QML component +Any element in a QML file - including nested elements and nested QML component instances - can use this attached property. If there is more than one \c onCompleted() handler to execute at startup, they are run sequentially in an undefined order. diff --git a/doc/src/declarative/network.qdoc b/doc/src/declarative/network.qdoc index 0a26c68..d268a13 100644 --- a/doc/src/declarative/network.qdoc +++ b/doc/src/declarative/network.qdoc @@ -69,8 +69,10 @@ Network transparency is supported throughout QML, for example: \endlist Even QML types themselves can be on the network - if the \l {Qt Declarative UI Runtime}{qml} tool is used to load -\tt http://example.com/mystuff/Hello.qml and that content refers to a type "World", this -will load from \tt http://example.com/mystuff/World.qml just as it would for a local file. +\tt http://example.com/mystuff/Hello.qml and that content refers to a type "World", the engine +will load \tt http://example.com/mystuff/qmldir and resolve the type just as it would for a local file. +For example if the qmldir file contains the line "World World.qml", it will load +\tt http://example.com/mystuff/World.qml Any other resources that \tt Hello.qml referred to, usually by a relative URL, would similarly be loaded from the network. diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index cbb2146..b4d8a2e 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -70,9 +70,7 @@ \macro QML_DECLARE_TYPE() \relates QDeclarativeEngine - Declares a C++ type to be usable in the QML system. In addition - to this, a type must also be registered with the QML system using - qmlRegisterType(). + Equivalent to Q_DECLARE_METATYPE(TYPE) and Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>) */ @@ -83,7 +81,6 @@ This template function registers the C++ type in the QML system with the name \a qmlName. in the library imported from \a uri having the version number composed from \a versionMajor and \a versionMinor. - The type should also haved been declared with the QML_DECLARE_TYPE() macro. Returns the QML type id. @@ -114,7 +111,6 @@ This template function registers the C++ type in the QML system under the name \a typeName. - The type should also haved been declared with the QML_DECLARE_TYPE() macro. Returns the QML type id. diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h b/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h index 028718f..73d66b7 100644 --- a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h +++ b/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h @@ -39,7 +39,6 @@ ** ****************************************************************************/ //![0] -#include <QtDeclarative/qdeclarative.h> #include <QGraphicsWidget> #include <QPainter> @@ -53,6 +52,4 @@ public: painter->drawEllipse(0, 0, size().width(), size().height()); } }; - -QML_DECLARE_TYPE(BlueCircle) //![0] diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h b/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h index 76e7d11..3050662 100644 --- a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h +++ b/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h @@ -39,7 +39,6 @@ ** ****************************************************************************/ //![0] -#include <QtDeclarative/qdeclarative.h> #include <QGraphicsWidget> #include <QPainter> @@ -52,6 +51,4 @@ public: painter->fillRect(0, 0, size().width(), size().height(), QColor(Qt::red)); } }; - -QML_DECLARE_TYPE(RedSquare) //![0] diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 1c78118..d5920b9 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -719,6 +719,21 @@ float: right; color: #254117; } + + .qmldefault + { + float: right; + color: red; + } + + .qmldoc + { + } + + *.qmlitem p + { + } + #feedbackBox { display:none; |