diff options
Diffstat (limited to 'doc/src/qtquick2')
-rw-r--r-- | doc/src/qtquick2/animation.qdoc | 28 | ||||
-rw-r--r-- | doc/src/qtquick2/focus.qdoc | 22 | ||||
-rw-r--r-- | doc/src/qtquick2/modelview.qdoc | 30 | ||||
-rw-r--r-- | doc/src/qtquick2/mouseevents.qdoc | 6 | ||||
-rw-r--r-- | doc/src/qtquick2/positioners.qdoc | 8 | ||||
-rw-r--r-- | doc/src/qtquick2/qmltexthandling.qdoc | 4 | ||||
-rw-r--r-- | doc/src/qtquick2/qtquick-intro.qdoc | 10 | ||||
-rw-r--r-- | doc/src/qtquick2/qtquick2.qdoc | 2 | ||||
-rw-r--r-- | doc/src/qtquick2/righttoleft.qdoc | 12 | ||||
-rw-r--r-- | doc/src/qtquick2/states.qdoc | 6 | ||||
-rw-r--r-- | doc/src/qtquick2/writingcomponents.qdoc | 34 |
11 files changed, 81 insertions, 81 deletions
diff --git a/doc/src/qtquick2/animation.qdoc b/doc/src/qtquick2/animation.qdoc index 626571f50e..cf656fb209 100644 --- a/doc/src/qtquick2/animation.qdoc +++ b/doc/src/qtquick2/animation.qdoc @@ -76,14 +76,14 @@ There are several ways of setting animation to an object. To create an immediate movement or animated movement, set the property value directly. This may be done in signal handlers or attached properties. -\snippet doc/src/snippets/declarative/animation.qml direct property change +\snippet doc/src/snippets/qml/animation.qml direct property change However, to create more control, \i {property animations} apply smooth movements by interpolating values between property value changes. Property animations provide timing controls and allows different interpolations through \l{qml-easing-animation}{easing curves}. -\snippet doc/src/snippets/declarative/animation.qml property animation +\snippet doc/src/snippets/qml/animation.qml property animation Specialized \l{qml-property-animation-elements}{property animation elements} have more efficient implementations than the \l{PropertyAnimation} element. They @@ -112,14 +112,14 @@ change from the \c pressed state to the \c released state. Likewise, there would be an animation during the change from the \c released state to the \c pressed state. -\snippet doc/src/snippets/declarative/animation.qml transition animation +\snippet doc/src/snippets/qml/animation.qml transition animation Binding the \c to and \c from properties to the state's name will assign that particular transition to the state change. For simple or symmetric transitions, setting the to \c to property to the wild card symbol, "\c{*}", denotes that the transition applies to any state change. -\snippet doc/src/snippets/declarative/animation.qml wildcard animation +\snippet doc/src/snippets/qml/animation.qml wildcard animation \section2 Default Animation as Behaviors @@ -133,7 +133,7 @@ A ball component might have a behavior animation assigned to its \c x, \c y, and elastic effect. In effect, this behavior animation would apply the elastic effect to the properties whenever the ball moves. -\snippet doc/src/snippets/declarative/animation.qml behavior animation +\snippet doc/src/snippets/qml/animation.qml behavior animation There are several methods of assigning behavior animations to properties. The \c{Behavior on <property>} declaration is a convenient way of assigning a @@ -156,7 +156,7 @@ object. Using the \l{SequentialAnimation} element, the opacity animations will play after the preceding animation finishes. The \l{ParallelAnimation} element will play the animations at the same time. -\snippet doc/src/snippets/declarative/animation.qml sequential animation +\snippet doc/src/snippets/qml/animation.qml sequential animation Once individual animations are placed into a SequentialAnimation or ParallelAnimation, they can no longer be started and stopped independently. The @@ -257,15 +257,15 @@ Rectangle { -\snippet doc/src/snippets/declarative/animation-elements.qml color -\snippet doc/src/snippets/declarative/animation-propertyvaluesource.qml 0 -\snippet doc/src/snippets/declarative/animation-signalhandler.qml 0 -\snippet doc/src/snippets/declarative/animation-standalone.qml 0 +\snippet doc/src/snippets/qml/animation-elements.qml color +\snippet doc/src/snippets/qml/animation-propertyvaluesource.qml 0 +\snippet doc/src/snippets/qml/animation-signalhandler.qml 0 +\snippet doc/src/snippets/qml/animation-standalone.qml 0 -\snippet doc/src/snippets/declarative/animation-transitions.qml 0 -\snippet doc/src/snippets/declarative/animation-groups.qml 0 +\snippet doc/src/snippets/qml/animation-transitions.qml 0 +\snippet doc/src/snippets/qml/animation-groups.qml 0 -\snippet doc/src/snippets/declarative/animation-groups.qml 1 -\snippet doc/src/snippets/declarative/animation-groups.qml 0 +\snippet doc/src/snippets/qml/animation-groups.qml 1 +\snippet doc/src/snippets/qml/animation-groups.qml 0 \image propanim.gif diff --git a/doc/src/qtquick2/focus.qdoc b/doc/src/qtquick2/focus.qdoc index 05d797e7be..e2c4c79d3c 100644 --- a/doc/src/qtquick2/focus.qdoc +++ b/doc/src/qtquick2/focus.qdoc @@ -43,7 +43,7 @@ and to address some of the cases unique to fluid user interfaces, the QML items When the user presses or releases a key, the following occurs: \list 1 \o Qt receives the key action and generates a key event. -\o If the Qt widget containing the \l QDeclarativeView has focus, the key event +\o If the Qt widget containing the \l QQuickView has focus, the key event is delivered to it. Otherwise, regular Qt key handling continues. \o The key event is delivered by the scene to the QML \l Item with \i {active focus}. If no Item has active focus, the key event is @@ -56,8 +56,8 @@ If the \c {Rectangle} element in the following example has active focus and the it will bubble up to its parent. However, pressing the \c B key will bubble up to the root item and thus subsequently be ignored. -\snippet doc/src/snippets/declarative/focus/rectangle.qml simple key event -\snippet doc/src/snippets/declarative/focus/rectangle.qml simple key event end +\snippet doc/src/snippets/qml/focus/rectangle.qml simple key event +\snippet doc/src/snippets/qml/focus/rectangle.qml simple key event end \o If the root \l Item is reached, the key event is \l {QEvent::ignore()}{ignored} and regular Qt key handling continues. @@ -71,7 +71,7 @@ Whether or not an \l Item has active focus can be queried through the property \c {Item::activeFocus} property. For example, here we have a \l Text element whose text is determined by whether or not it has active focus. -\snippet doc/src/snippets/declarative/focus/rectangle.qml active focus +\snippet doc/src/snippets/qml/focus/rectangle.qml active focus \section1 Acquiring Focus and Focus Scopes @@ -82,7 +82,7 @@ sufficient. If we run the following example with the \l {QML Viewer}, we see tha the \c {keyHandler} element has active focus and pressing the \c A, \c B, or \c C keys modifies the text appropriately. -\snippet doc/src/snippets/declarative/focus/basicwidget.qml focus true +\snippet doc/src/snippets/qml/focus/basicwidget.qml focus true \image declarative-qmlfocus1.png @@ -95,10 +95,10 @@ set the first one to have focus. The intention is that when the \c A, \c B, or responds accordingly. The code that imports and creates two MyWidget instances: -\snippet doc/src/snippets/declarative/focus/widget.qml window +\snippet doc/src/snippets/qml/focus/widget.qml window The MyWidget code: -\snippet doc/src/snippets/declarative/focus/MyWidget.qml mywidget +\snippet doc/src/snippets/qml/focus/MyWidget.qml mywidget We would like to have the first MyWidget object to have the focus by setting its \c focus property to \c true. However, by running the code, we can confirm that @@ -126,7 +126,7 @@ A focus scope is created by declaring the \l FocusScope element. In the next example, a \l FocusScope element is added to the component, and the visual result shown. -\snippet doc/src/snippets/declarative/focus/myfocusscopewidget.qml widget in focusscope +\snippet doc/src/snippets/qml/focus/myfocusscopewidget.qml widget in focusscope \image declarative-qmlfocus3.png @@ -158,10 +158,10 @@ Now, clicking either MyClickableWidget gives it focus and the other widget loses the focus. The code that imports and creates two MyClickableWidget instances: -\snippet doc/src/snippets/declarative/focus/clickablewidget.qml clickable window +\snippet doc/src/snippets/qml/focus/clickablewidget.qml clickable window The MyClickableWidget code: -\snippet doc/src/snippets/declarative/focus/MyClickableWidget.qml clickable in focusscope +\snippet doc/src/snippets/qml/focus/MyClickableWidget.qml clickable in focusscope \image declarative-qmlfocus4.png @@ -188,7 +188,7 @@ current item delegate to react to key presses. This contrived example shows how this works. Pressing the \c Return key will print the name of the current list item. -\snippet doc/src/snippets/declarative/focus/advancedFocus.qml FocusScope delegate +\snippet doc/src/snippets/qml/focus/advancedFocus.qml FocusScope delegate \image declarative-qmlfocus5.png diff --git a/doc/src/qtquick2/modelview.qdoc b/doc/src/qtquick2/modelview.qdoc index 56c726eab8..5d799027ad 100644 --- a/doc/src/qtquick2/modelview.qdoc +++ b/doc/src/qtquick2/modelview.qdoc @@ -80,13 +80,13 @@ To visualize data, bind the view's \c model property to a model and the Suppose that a specific club wants to decorate its members list with its brand colors. A member list is in a \c model and the \c delegate will display the model's content. - \snippet doc/src/snippets/declarative/listview-decorations.qml model - \snippet doc/src/snippets/declarative/listview-decorations.qml delegate + \snippet doc/src/snippets/qml/listview-decorations.qml model + \snippet doc/src/snippets/qml/listview-decorations.qml delegate The club may decorate the members list by binding visual objects to the \c header and \c footer properties. The visual object may be defined inline, in another file, or in a \l {Component} element. - \snippet doc/src/snippets/declarative/listview-decorations.qml decorations + \snippet doc/src/snippets/qml/listview-decorations.qml decorations \image listview-decorations.png \section2 Mouse and Touch Handling @@ -110,8 +110,8 @@ To visualize data, bind the view's \c model property to a model and the A list may contain a list indicating people's names and the team on which team the person belongs. - \snippet doc/src/snippets/declarative/listview-sections.qml model - \snippet doc/src/snippets/declarative/listview-sections.qml delegate + \snippet doc/src/snippets/qml/listview-sections.qml model + \snippet doc/src/snippets/qml/listview-sections.qml delegate The ListView element has the \c section \l{Property Binding in QML#Attached Properties}{attached property} that can combine adjacent and related @@ -119,7 +119,7 @@ To visualize data, bind the view's \c model property to a model and the which list element property to use as sections. The \c criteria can dictate how the section names are displayed and the \c delegate is similar to the views' \l {qml-view-delegate}{delegate} property. - \snippet doc/src/snippets/declarative/listview-sections.qml section + \snippet doc/src/snippets/qml/listview-sections.qml section \image listview-section.png \keyword qml-view-delegate @@ -129,7 +129,7 @@ To visualize data, bind the view's \c model property to a model and the visualize each item list according to the template defined by the delegate. Items in a model are accessible through the \c index property as well as the item's properties. - \snippet doc/src/snippets/declarative/listview.qml delegate + \snippet doc/src/snippets/qml/listview.qml delegate \image listview-setup.png \section2 Accessing Views and Models from Delegates @@ -150,7 +150,7 @@ To visualize data, bind the view's \c model property to a model and the the model, and the color of one of the fields depends on the property \i{fruit_color} of the view. - \snippet doc/src/snippets/declarative/models/views-models-delegates.qml rectangle + \snippet doc/src/snippets/qml/models/views-models-delegates.qml rectangle \keyword qml-data-models \section1 Models @@ -159,7 +159,7 @@ To visualize data, bind the view's \c model property to a model and the bind to. Here is a ListModel with two roles, \i type and \i age, and a ListView with a delegate that binds to these roles to display their values: - \snippet doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml document + \snippet doc/src/snippets/qml/qml-data-models/listmodel-listview.qml document If there is a naming clash between the model's properties and the delegate's properties, the roles can be accessed with the qualified \i model name @@ -197,12 +197,12 @@ To visualize data, bind the view's \c model property to a model and the ListModel is a simple hierarchy of elements specified in QML. The available roles are specified by the \l ListElement properties. - \snippet doc/src/snippets/declarative/qml-data-models/listelements.qml model + \snippet doc/src/snippets/qml/qml-data-models/listelements.qml model The above model has two roles, \i name and \i cost. These can be bound to by a ListView delegate, for example: - \snippet doc/src/snippets/declarative/qml-data-models/listelements.qml view + \snippet doc/src/snippets/qml/qml-data-models/listelements.qml view ListModel provides methods to manipulate the ListModel directly via JavaScript. In this case, the first item inserted determines the roles available @@ -210,9 +210,9 @@ To visualize data, bind the view's \c model property to a model and the created and populated via JavaScript, the roles provided by the first insertion are the only roles that will be shown in the view: - \snippet doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml model + \snippet doc/src/snippets/qml/qml-data-models/dynamic-listmodel.qml model \dots - \snippet doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml mouse area + \snippet doc/src/snippets/qml/qml-data-models/dynamic-listmodel.qml mouse area When the MouseArea is clicked, \c fruitModel will have two roles, \i cost and \i name. Even if subsequent roles are added, only the first two will be handled by views @@ -253,7 +253,7 @@ To visualize data, bind the view's \c model property to a model and the VisualItemModel provide the contents of the delegate. The model does not provide any roles. - \snippet doc/src/snippets/declarative/models/visual-model-and-view.qml visual model and view + \snippet doc/src/snippets/qml/models/visual-model-and-view.qml visual model and view Note that in the above example there is no delegate required. The items of the model itself provide the visual elements that @@ -347,7 +347,7 @@ The following example shows a repeater used with a \l{#Grid}{Grid} item to arrange a set of Rectangle items. The Repeater item creates a series of 24 rectangles for the Grid item to position in a 5 by 5 arrangement. -\snippet doc/src/snippets/declarative/repeaters/repeater-grid-index.qml document +\snippet doc/src/snippets/qml/repeaters/repeater-grid-index.qml document The number of items created by a Repeater is held by its \l{Repeater::}{count} property. It is not possible to set this property to determine the number of diff --git a/doc/src/qtquick2/mouseevents.qdoc b/doc/src/qtquick2/mouseevents.qdoc index d981c7c1dd..e452611416 100644 --- a/doc/src/qtquick2/mouseevents.qdoc +++ b/doc/src/qtquick2/mouseevents.qdoc @@ -55,7 +55,7 @@ to define this area is to anchor the \c MouseArea to its parent's area using the component), then the MouseArea will fill the area defined by the parent's dimensions. Alternatively, an area smaller or larger than the parent is definable. -\snippet doc/src/snippets/declarative/mousearea/mousearea-snippet.qml anchor fill +\snippet doc/src/snippets/qml/mousearea/mousearea-snippet.qml anchor fill \section1 Receiving Events @@ -77,7 +77,7 @@ gestures in greater detail: \endlist These signals have signal handlers that are invoked when the signals are emitted. -\snippet doc/src/snippets/declarative/mousearea/mousearea-snippet.qml mouse handlers +\snippet doc/src/snippets/qml/mousearea/mousearea-snippet.qml mouse handlers \section1 Enabling Gestures Some mouse gestures and button clicks need to be enabled before they send or @@ -95,7 +95,7 @@ positioning even when there are no mouse button presses. Setting the \c hoverEnabled property to \c true, in turn will enable the \c entered, \c exited, and \c positionChanged signal and their respective signal handlers. -\snippet doc/src/snippets/declarative/mousearea/mousearea-snippet.qml enable handlers +\snippet doc/src/snippets/qml/mousearea/mousearea-snippet.qml enable handlers Additionally, to disable the whole mouse area, set the \c MouseArea element's \c enabled property to \c false. diff --git a/doc/src/qtquick2/positioners.qdoc b/doc/src/qtquick2/positioners.qdoc index c7110f7cf9..55be7087fd 100644 --- a/doc/src/qtquick2/positioners.qdoc +++ b/doc/src/qtquick2/positioners.qdoc @@ -61,7 +61,7 @@ uses a Column item to arrange three \l Rectangle items in an area defined by an outer \l Item. The \l{Column::spacing}{spacing} property is set to include a small amount of space between the rectangles. -\snippet doc/src/snippets/declarative/column/column.qml document +\snippet doc/src/snippets/qml/column/column.qml document Note that, since Column inherits directly from Item, any background color must be added to a parent Rectangle, if desired. @@ -80,7 +80,7 @@ include a small amount of space between the rectangles. We ensure that the parent Rectangle is large enough so that there is some space left around the edges of the horizontally centered Row item. -\snippet doc/src/snippets/declarative/row.qml document +\snippet doc/src/snippets/qml/row.qml document \section2 Grid @@ -93,7 +93,7 @@ The following example uses a Grid item to place four \l Rectangle items in a 2-by-2 grid. As with the other positioners, the spacing between items can be specified using the \l{Grid::spacing}{spacing} property. -\snippet doc/src/snippets/declarative/grid-spacing.qml document +\snippet doc/src/snippets/qml/grid-spacing.qml document There is no difference between horizontal and vertical spacing inserted between items, so any additional space must be added within the items @@ -122,7 +122,7 @@ The following example shows a Flow item containing a number of \l Text child items. These are arranged in a similar way to those shown in the screenshots. -\snippet doc/src/snippets/declarative/flow.qml document +\snippet doc/src/snippets/qml/flow.qml document The main differences between the Grid and Flow positioners are that items inside a Flow will wrap when they run out of space on the minor axis, and diff --git a/doc/src/qtquick2/qmltexthandling.qdoc b/doc/src/qtquick2/qmltexthandling.qdoc index 876ab3c42f..6e6b2a4c6b 100644 --- a/doc/src/qtquick2/qmltexthandling.qdoc +++ b/doc/src/qtquick2/qmltexthandling.qdoc @@ -62,10 +62,10 @@ respective element documentation. The \l {Validators}{validator} elements enforce the type and format of \l TextInput objects. -\snippet doc/src/snippets/declarative/texthandling.qml int validator +\snippet doc/src/snippets/qml/texthandling.qml int validator The validator elements bind to \c {TextInput}'s \c validator property. -\snippet doc/src/snippets/declarative/texthandling.qml regexp validator +\snippet doc/src/snippets/qml/texthandling.qml regexp validator The regular expression in the snippet will only allow the inputted text to be \c {fruit basket}. diff --git a/doc/src/qtquick2/qtquick-intro.qdoc b/doc/src/qtquick2/qtquick-intro.qdoc index 8aeab7e199..9eebb0bddc 100644 --- a/doc/src/qtquick2/qtquick-intro.qdoc +++ b/doc/src/qtquick2/qtquick-intro.qdoc @@ -34,7 +34,7 @@ create the kind of intuitive, modern, and fluid user interfaces that are increasingly used on mobile phones, media players, set-top boxes, and other portable devices. Qt Quick consists of a rich set of user interface \l{QML Elements}{elements}, a \l{QML Syntax}{declarative} language for -describing user interfaces, and a language \l{QtDeclarative Module}{runtime}. A +describing user interfaces, and a language \l{QtQml Module}{runtime}. A collection of C++ APIs is used to integrate these high level features with classic Qt applications. Version 2.1 of the Qt Creator integrated development environment (IDE) introduces tools for developing Qt Quick applications. @@ -74,16 +74,16 @@ used to implement high level user interface logic. \l{How to Learn QML} introduces the reader to the language and declarative concepts. -\section1 QtDeclarative Module +\section1 QtQml Module -To make Qt Quick possible, Qt introduces the \l{QtDeclarative} module. The +To make Qt Quick possible, Qt introduces the \l{QtQml} module. The module creates a JavaScript runtime that QML runs under with a Qt based backend. -Because QtDeclarative and QML are built upon Qt, they inherit many of Qt's +Because QtQml and QML are built upon Qt, they inherit many of Qt's technology, namely the \l{Signals and Slots}{signals and slots} mechanism and the \l{The Meta-Object System}{meta-object} system. Data created using C++ are directly accessible from QML, and QML objects are also accessible from C++ code. -The QtDeclarative module separates the interface logic in QML from the +The QtQml module separates the interface logic in QML from the application logic in C++. It also allows the range of standard QML elements to be \l{Extending QML with C++}{extended with new ones written in C++}. diff --git a/doc/src/qtquick2/qtquick2.qdoc b/doc/src/qtquick2/qtquick2.qdoc index 6a1b7999c9..20361adb16 100644 --- a/doc/src/qtquick2/qtquick2.qdoc +++ b/doc/src/qtquick2/qtquick2.qdoc @@ -32,7 +32,7 @@ \brief The QML Elements This QML module contains all the QML elements that are - instantiated as objects of C++ classes in the QtDeclarative + instantiated as objects of C++ classes in the QtQml module. These elements work with the Scenegraph renderer and their own canvas. */ diff --git a/doc/src/qtquick2/righttoleft.qdoc b/doc/src/qtquick2/righttoleft.qdoc index b2cff57ee0..1781e3582a 100644 --- a/doc/src/qtquick2/righttoleft.qdoc +++ b/doc/src/qtquick2/righttoleft.qdoc @@ -68,7 +68,7 @@ Note that when \l LayoutMirroring is set, the \c horizontalAlignment property va the effective alignment of the text element that takes the mirroring into account can be read from the \c effectiveHorizontalAlignment property. -\snippet doc/src/snippets/declarative/righttoleft.qml 0 +\snippet doc/src/snippets/qml/righttoleft.qml 0 \section1 Layout direction of positioners and views @@ -84,7 +84,7 @@ This causes the effective \c layoutDirection of positioners and views to be mirr of the \c layoutDirection property will remain unchanged; the effective layout direction of positioners and views that takes the mirroring into account can be read from the \c effectiveLayoutDirection property. -\snippet doc/src/snippets/declarative/righttoleft.qml 1 +\snippet doc/src/snippets/qml/righttoleft.qml 1 \section1 Layout mirroring @@ -95,11 +95,11 @@ support for existing left-to-right Qt Quick applications. It mirrors the behavio You can enable layout mirroring for a particular \l Item: -\snippet doc/src/snippets/declarative/righttoleft.qml 2 +\snippet doc/src/snippets/qml/righttoleft.qml 2 Or set all child elements to also inherit the layout direction: -\snippet doc/src/snippets/declarative/righttoleft.qml 3 +\snippet doc/src/snippets/qml/righttoleft.qml 3 Applying mirroring in this manner does not change the actual value of the relevant anchor, \c layoutDirection or \c horizontalAlignment properties. The separate read-only property @@ -116,7 +116,7 @@ especially in views that rely on both the anchors and x coordinate-based positio the \l LayoutMirroring attached property to apply mirroring to an item that is positioned using \l {Item::}{x} coordinates: -\snippet doc/src/snippets/declarative/righttoleft.qml 4 +\snippet doc/src/snippets/qml/righttoleft.qml 4 Not all layouts should necessarily be mirrored. There are cases where a visual element is positioned to the right side of the screen for improved one-handed use, because most people are right-handed, and not @@ -135,7 +135,7 @@ aligned and just make sure that text is translated and aligned properly. Most images do not need to be mirrored, but some directional icons, such as arrows, may need to be mirrored. The painting of these icons can be mirrored with a dedicated \c mirror property introduced in Qt Quick 1.1: -\snippet doc/src/snippets/declarative/righttoleft.qml 5 +\snippet doc/src/snippets/qml/righttoleft.qml 5 \section1 Default layout direction diff --git a/doc/src/qtquick2/states.qdoc b/doc/src/qtquick2/states.qdoc index 559b4facac..622a1619b0 100644 --- a/doc/src/qtquick2/states.qdoc +++ b/doc/src/qtquick2/states.qdoc @@ -80,7 +80,7 @@ signal should be \c green and the warning \c flag is down. Meanwhile, in the \c CRITICAL state, the \c color should be \c red and the flag is \c up. We may model the states using the \c State element and the color and flag configurations with the \c PropertyChanges element. -\snippet doc/src/snippets/declarative/states.qml signal states +\snippet doc/src/snippets/qml/states.qml signal states The \l PropertyChanges element will change the values of object properties. Objects are referenced through their \l {qml-id}{id}. Objects outside the component are also referenced using the \c id property, exemplified by the @@ -89,7 +89,7 @@ property change to the external \c flag object. Further, the state may change by assigning the \c state property with the appropriate signal state. A state switch could be in a \l MouseArea element, assigning a different state whenever the signal receives a mouse click. -\snippet doc/src/snippets/declarative/states.qml switch states +\snippet doc/src/snippets/qml/states.qml switch states The State element is not limited to performing modifications on property values. It can also: @@ -115,7 +115,7 @@ expressions to change the state whenever the bound expression evaluates to \c true. The \c when property will revert the state back to the \l {The Default State}{default state} when the expression evaluates to false. -\snippet doc/src/snippets/declarative/states.qml when property +\snippet doc/src/snippets/qml/states.qml when property The \c bell component will change to the \c RINGING state whenever the \c signal.state is \c CRITICAL. diff --git a/doc/src/qtquick2/writingcomponents.qdoc b/doc/src/qtquick2/writingcomponents.qdoc index 64d28eff0b..31267cf20c 100644 --- a/doc/src/qtquick2/writingcomponents.qdoc +++ b/doc/src/qtquick2/writingcomponents.qdoc @@ -55,14 +55,14 @@ For example, one of the simplest and most common components you can build in QML button-type component. Below, we implement this component as a \l Rectangle with a clickable \l MouseArea, in a file named \c Button.qml: -\snippet doc/src/snippets/declarative/qml-extending-types/components/Button.qml 0 +\snippet doc/src/snippets/qml/qml-extending-types/components/Button.qml 0 Now this component can be reused by another file within the same directory. Since the file is named \c Button.qml, the component is referred to as \c Button: \table \row -\o \snippet doc/src/snippets/declarative/qml-extending-types/components/application.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/components/application.qml 0 \o \image qml-extending-types.png \endtable @@ -73,7 +73,7 @@ customize the \c width, \c height, \c radius and \c color properties of \c Butto If \c Button.qml was not in the same directory, \c application.qml would need to load it as a -\l {Modules}{module} from a specific filesystem path or \l{QDeclarativeExtensionPlugin}{plugin}. +\l {Modules}{module} from a specific filesystem path or \l{QQmlExtensionPlugin}{plugin}. Also, note the letter case of the component file name is significant on some (notably UNIX) filesystems. It is recommended the file name case matches the case of the QML component name exactly - for example, \c Box.qml and not \c BoX.qml - regardless of the platform to which the @@ -119,8 +119,8 @@ an \c ImageViewer object and read or modify the \c currentImage value: \table \row -\o \snippet doc/src/snippets/declarative/qml-extending-types/properties/ImageViewer.qml 0 -\o \snippet doc/src/snippets/declarative/qml-extending-types/properties/application.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/properties/ImageViewer.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/properties/application.qml 0 \endtable It is optional for a property to have a default value. The default value is a convenient shortcut, and is @@ -195,7 +195,7 @@ property name. For example, the following \c onMyNumberChanged signal handler is automatically called whenever the \c myNumber property changes: -\snippet doc/src/snippets/declarative/qml-extending-types/properties/property-signals.qml 0 +\snippet doc/src/snippets/qml/qml-extending-types/properties/property-signals.qml 0 \section2 Default properties @@ -266,7 +266,7 @@ declaring the alias, and, optionally, <property> refers to a property on that ob For example, below is a \c Button.qml component with a \c buttonText aliased property which is connected to the child Text object's \c text property: -\snippet doc/src/snippets/declarative/qml-extending-types/properties/alias.qml 0 +\snippet doc/src/snippets/qml/qml-extending-types/properties/alias.qml 0 The following code would create a \c Button with a defined text string for the child \l Text object: @@ -290,8 +290,8 @@ been changed to an alias to the child \l Image object: \table \row -\o \snippet doc/src/snippets/declarative/qml-extending-types/properties/alias/ImageViewer.qml 0 -\o \snippet doc/src/snippets/declarative/qml-extending-types/properties/alias/application.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/properties/alias/application.qml 0 \endtable Instead of being limited to setting the \l Image source, \c application.qml can now directly @@ -335,7 +335,7 @@ It is possible for an aliased property to have the same name as an existing prop the following component has a \c color alias property, named the same as the built-in \l {Rectangle::color} property: -\snippet doc/src/snippets/declarative/qml-extending-types/properties/alias-override.qml 0 +\snippet doc/src/snippets/qml/qml-extending-types/properties/alias-override.qml 0 Any objects that use this component and refer to its \c color property will be referring to the alias rather than the ordinary \l {Rectangle::color} property. Internally, @@ -366,7 +366,7 @@ the parameters by name. Here is an example of a component with a \c say() method that accepts a single \c text argument: -\snippet doc/src/snippets/declarative/qml-extending-types/methods/app.qml 0 +\snippet doc/src/snippets/qml/qml-extending-types/methods/app.qml 0 A method can be connected to a signal so that it is automatically invoked whenever the signal is emitted. See \l {Connecting signals to methods and other signals} below. @@ -422,8 +422,8 @@ signal is received by \c application.qml through an \c onButtonClicked signal ha \table \row -\o \snippet doc/src/snippets/declarative/qml-extending-types/signals/basic.qml 0 -\o \snippet doc/src/snippets/declarative/qml-extending-types/signals/no-parameters.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/signals/basic.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/signals/no-parameters.qml 0 \endtable If the signal has parameters, they are accessible by parameter name in the signal handler. @@ -431,8 +431,8 @@ In the example below, \c buttonClicked is emitted with \c xPos and \c yPos param \table \row -\o \snippet doc/src/snippets/declarative/qml-extending-types/signals/Button.qml 0 -\o \snippet doc/src/snippets/declarative/qml-extending-types/signals/parameters.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/signals/Button.qml 0 +\o \snippet doc/src/snippets/qml/qml-extending-types/signals/parameters.qml 0 \endtable @@ -446,7 +446,7 @@ to be received by a method instead of a \l {Signal Handlers}{signal handler}. For example, the \c application.qml above could be rewritten as: -\snippet doc/src/snippets/declarative/qml-extending-types/signals/connectslots.qml 0 +\snippet doc/src/snippets/qml/qml-extending-types/signals/connectslots.qml 0 The \c myMethod() method will be called whenever the \c buttonClicked signal is received. @@ -458,7 +458,7 @@ or \l {Integrating JavaScript}{integrating JavaScript code}, then you will find objects dynamically, and connects the \c buttonClicked signal of each object to the \c myMethod() function: -\snippet doc/src/snippets/declarative/qml-extending-types/signals/connectdynamic.qml 0 +\snippet doc/src/snippets/qml/qml-extending-types/signals/connectdynamic.qml 0 In the same way, you could connect a signal to methods defined in a dynamically created object, or \l {Receiving QML Signals in JavaScript}{connect a signal to a JavaScript method}. |