From 08c422315d52a9377ebf0912adbe4d17370173af Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 30 Jun 2010 14:32:34 +1000 Subject: Docs - add more links to relevant examples Task-number: QTBUG-11754 --- doc/src/declarative/animation.qdoc | 16 ++++++++++++---- doc/src/declarative/dynamicobjects.qdoc | 4 ++++ doc/src/declarative/focus.qdoc | 4 ++++ doc/src/declarative/globalobject.qdoc | 4 ++++ doc/src/declarative/qdeclarativei18n.qdoc | 3 +++ doc/src/declarative/qdeclarativemodels.qdoc | 4 ++++ doc/src/declarative/qdeclarativestates.qdoc | 3 +++ doc/src/declarative/tutorial.qdoc | 2 +- src/declarative/graphicsitems/qdeclarativefocusscope.cpp | 2 ++ src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 ++ src/declarative/graphicsitems/qdeclarativeitem.cpp | 4 +++- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 2 +- src/declarative/graphicsitems/qdeclarativetext.cpp | 2 ++ src/declarative/graphicsitems/qdeclarativetextedit.cpp | 2 +- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 2 +- src/declarative/qml/qdeclarativeimageprovider.cpp | 2 +- src/declarative/qml/qdeclarativelist.cpp | 2 ++ .../qml/qdeclarativenetworkaccessmanagerfactory.cpp | 2 +- src/declarative/util/qdeclarativebehavior.cpp | 2 +- src/declarative/util/qdeclarativepropertychanges.cpp | 2 +- src/declarative/util/qdeclarativetimer.cpp | 2 ++ src/declarative/util/qdeclarativetransition.cpp | 2 +- src/declarative/util/qdeclarativexmllistmodel.cpp | 2 ++ src/imports/gestures/qdeclarativegesturearea.cpp | 2 +- 24 files changed, 59 insertions(+), 15 deletions(-) diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index 13202ee..c5333df 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -71,13 +71,15 @@ to explicitly set the \c target and \c property to animate. Animations can be joined into a group using SequentialAnimation and ParallelAnimation. +See the \l {declarative/animation/basics}{Animation basics example} for a demonstration of creating and combining multiple animations in QML. + \target state-transitions \section1 Transitions -QML transitions describe animations to perform when \l{qmlstates}{state} changes occur. A transition +\l Transition elements describe the animations to perform when \l{qmlstates}{state} changes occur. A transition can only be triggered by a state change. -For example, a transition could describe how an item moves from its initial position to its new position: +For example, a \l Transition could describe how an item moves from its initial position to its new position: \snippet doc/src/snippets/declarative/animation.qml transitions-1 @@ -108,9 +110,13 @@ making use of both sequential and parallel animations: \snippet doc/src/snippets/declarative/animation.qml transitions-3 + +See \l {declarative/animation/states}{States and Transitions example} for a simple example of how transitions can be applied. + + \section1 Property Behaviors -A \l{Behavior}{property behavior} specifies a default animation to run whenever the property's value changes, regardless +A property \l {Behavior}{behavior} specifies a default animation to run whenever the property's value changes, regardless of what caused the change. The \c enabled property can be used to force a \l Behavior to only apply under certain circumstances. @@ -119,7 +125,7 @@ whenever it changes. The animation will last 300 milliseconds and use an \l{Prop \snippet doc/src/snippets/declarative/animation.qml behavior -Like using an animation as a value source, when used in a Behavior and animation does not need to specify +Like using an animation as a value source, when used in a \l Behavior and animation does not need to specify a \c target or \c property. To trigger this behavior, we could enter a state that changes \c x: @@ -149,4 +155,6 @@ If \c x were bound to another property, triggering the binding would also trigge If a state change has a transition animation matching a property with a \l Behavior, the transition animation will override the \l Behavior for that state change. +The \l {declarative/animation/behaviors}{Behaviors example} shows how behaviors can be used to provide animations. + */ diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc index de65a12..a5e53a9 100644 --- a/doc/src/declarative/dynamicobjects.qdoc +++ b/doc/src/declarative/dynamicobjects.qdoc @@ -39,8 +39,12 @@ QML also supports the dynamic creation of objects from within JavaScript code. This is useful if the existing QML elements do not fit the needs of your application, and there are no C++ components involved. +See the {declarative/toys/dynamicscene}{Dynamic Scene example} for a 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 create a component which instantiates items, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index 699ebcb..cc546c0 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -266,6 +266,10 @@ When a QML item explicitly relinquishes focus (by setting its does not automatically select another element to receive focus. That is, it is possible for there to be no currently \e {active focus}. +See the {declarative/keyinteraction/focus}{Keyboard Focus example} for a +demonstration of moving keyboard focus between multiple areas using FocusScope +elements. + \section1 Advanced uses of Focus Scopes Focus scopes allow focus to allocation to be easily partitioned. Several diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index ecbaa9e..40fc3eb 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -114,6 +114,8 @@ browser. The following objects and properties are supported by the QML implemen \endtable +\sa {declarative/xml/xmlhttprequest}{XMLHttpRequest example} + \section1 Offline Storage API \section2 Database API @@ -132,6 +134,8 @@ The API can be used from JavaScript functions in your QML: The API conforms to the Synchronous API of the HTML5 Web Database API, \link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink. +\sa {declarative/sqllocalstorage}{SQL Local Storage example} + \section3 db = openDatabaseSync(identifier, version, description, estimated_size, callback(db)) Returns the database identified by \e identifier. If the database does not already exist, it diff --git a/doc/src/declarative/qdeclarativei18n.qdoc b/doc/src/declarative/qdeclarativei18n.qdoc index c16dea3..40f7919 100644 --- a/doc/src/declarative/qdeclarativei18n.qdoc +++ b/doc/src/declarative/qdeclarativei18n.qdoc @@ -78,4 +78,7 @@ Finally, we can test the translation: \code qml -translation hello.qm hello.qml \endcode + + +You can see a complete example and source code in the {declarative/i18n}{QML Internationalization example}. */ diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index bb17896..7671eb3 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -279,6 +279,8 @@ ListView { \endcode \endtable +The complete example is available in \l {declarative/modelviews/stringlistmodel}. + \note There is no way for the view to know that the contents of a QStringList have changed. If the QStringList is changed, it will be necessary to reset the model by calling QDeclarativeContext::setContextProperty() again. @@ -329,6 +331,8 @@ ListView { } \endcode +The complete example is available in \l {declarative/modelviews/objectlistmodel}. + Note the use of the fully qualified access to the \c color property. The properties of the object are not replicated in the \c model object, since they are easily available via the modelData diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc index ef5bf98..6461925 100644 --- a/doc/src/declarative/qdeclarativestates.qdoc +++ b/doc/src/declarative/qdeclarativestates.qdoc @@ -82,4 +82,7 @@ Other things you can do in a state change: \o Run some script with StateChangeScript \endlist + +The {declarative/animation/states}{States and Transitions example} demonstrates how to declare a basic set of states and then apply animated transitions between them. + */ diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc index 252c11e..c884486 100644 --- a/doc/src/declarative/tutorial.qdoc +++ b/doc/src/declarative/tutorial.qdoc @@ -222,5 +222,5 @@ This is equivalent to writing the two transitions separately. The \l ParallelAnimation element makes sure that the two types of animations (number and color) start at the same time. We could also run them one after the other by using \l SequentialAnimation instead. -For more details on states and transitions, see \l {QML States}. +For more details on states and transitions, see \l {QML States} and the {declarative/animation/states}{states and transitions example}. */ diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp index 4bd2a86..e8e6fa2 100644 --- a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp +++ b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp @@ -54,6 +54,8 @@ QT_BEGIN_NAMESPACE Focus scopes assist in keyboard focus handling when building reusable QML components. All the details are covered in the \l {qmlfocus}{keyboard focus documentation}. + + \sa {declarative/keyinteraction/focus}{Keyboard focus example} */ /*! diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index dda1efb..cb99129 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1099,6 +1099,8 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped nicely. + + \sa {declarative/modelviews/gridview}{GridView example} */ QDeclarativeGridView::QDeclarativeGridView(QDeclarativeItem *parent) : QDeclarativeFlickable(*(new QDeclarativeGridViewPrivate), parent) diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 336010f..9a17d78 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -149,7 +149,7 @@ QT_BEGIN_NAMESPACE } \endqml - \sa Rotate, Translate + \sa Rotation, Translate */ /*! @@ -196,6 +196,8 @@ QT_BEGIN_NAMESPACE \snippet doc/src/snippets/declarative/rotation.qml 0 \image axisrotation.png + + \sa {declarative/ui-components/dialcontrol}{Dial Control example}, {declarative/toys/clocks}{Clocks example} */ /*! diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 0bed41b..caf251d 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -192,7 +192,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() MouseArea is an invisible item: it is never painted. - \sa MouseEvent + \sa MouseEvent, {declarative/touchinteraction/mousearea}{MouseArea example} */ /*! diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 2ba680d..4152b4e 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -136,6 +136,8 @@ QSet QTextDocumentWithImageResources::errors; HTML img tags that load remote images, the text is reloaded. Text provides read-only text. For editable text, see \l TextEdit. + + \sa {declarative/text/fonts}{Fonts example} */ /*! diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index bafa10c..99cc648 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -99,7 +99,7 @@ TextEdit { You can translate between cursor positions (characters from the start of the document) and pixel points using positionAt() and positionToRectangle(). - \sa Text, TextInput + \sa Text, TextInput, {declarative/text/textselection}{Text Selection example} */ /*! diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index ef40f98..56150e4 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE On Mac OS X, the Up/Down key bindings for Home/End are explicitly disabled. If you want such bindings (on any platform), you will need to construct them in QML. - \sa TextEdit, Text + \sa TextEdit, Text, {declarative/text/textselection}{Text Selection example} */ QDeclarativeTextInput::QDeclarativeTextInput(QDeclarativeItem* parent) : QDeclarativePaintedItem(*(new QDeclarativeTextInputPrivate), parent) diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index 4be3472..f4a8588 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE \note the request() method may be called by multiple threads, so ensure the implementation of this method is reentrant. - \sa QDeclarativeEngine::addImageProvider() + \sa QDeclarativeEngine::addImageProvider(), {declarative/cppextensions/imageprovider}{ImageProvider example} */ /*! diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp index 31ef4c2..7c89672 100644 --- a/src/declarative/qml/qdeclarativelist.cpp +++ b/src/declarative/qml/qdeclarativelist.cpp @@ -341,6 +341,8 @@ QML list properties are typesafe - in this case \c {Fruit} is a QObject type tha \note QDeclarativeListProperty can only be used for lists of QObject-derived object pointers. +\sa {Object and List Property Types} + */ /*! diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp index 399831d..d22798d 100644 --- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp +++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE Note: the create() method may be called by multiple threads, so ensure the implementation of this method is reentrant. - \sa QDeclarativeEngine::setNetworkAccessManagerFactory() + \sa QDeclarativeEngine::setNetworkAccessManagerFactory(), {declarative/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example} */ /*! diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp index 90e0ca3..047993e 100644 --- a/src/declarative/util/qdeclarativebehavior.cpp +++ b/src/declarative/util/qdeclarativebehavior.cpp @@ -94,7 +94,7 @@ public: Currently only a single Behavior may be specified for a property; this Behavior can be enabled and disabled via the \l{enabled} property. - \sa QtDeclarative + \sa {declarative/animation/behaviors}{Behavior example}, QtDeclarative */ diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 8e3ec82..12c6353 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -145,7 +145,7 @@ QT_BEGIN_NAMESPACE an Item's parent should be done using the associated change elements (ParentChange and AnchorChanges, respectively). - \sa {qmlstate}{States}, QtDeclarative + \sa {declarative/animation/states}{states example}, {qmlstate}{States}, QtDeclarative */ /*! diff --git a/src/declarative/util/qdeclarativetimer.cpp b/src/declarative/util/qdeclarativetimer.cpp index 9e18eb5..576995f 100644 --- a/src/declarative/util/qdeclarativetimer.cpp +++ b/src/declarative/util/qdeclarativetimer.cpp @@ -103,6 +103,8 @@ public: 1000ms has its \e repeat property changed 500ms after starting, the elapsed time will be reset to 0, and the Timer will be triggered 1000ms later. + + \sa {declarative/toys/clocks}{Clocks example} */ QDeclarativeTimer::QDeclarativeTimer(QObject *parent) diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp index ab8b116..38ed97e 100644 --- a/src/declarative/util/qdeclarativetransition.cpp +++ b/src/declarative/util/qdeclarativetransition.cpp @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE \since 4.7 \brief The Transition element defines animated transitions that occur on state changes. - \sa {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative} + \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative} */ /*! diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index bfd25be..0692aaa 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -588,6 +588,8 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty