Doc: Do not refer to files in ComponentBehavior documentation
There may be multiple QML contexts created from one file. If you define a component in one of them, you cannot instantiate it in a different one. Pick-to: 6.4 Change-Id: I8a130f60bc03979bae7b22495737c3d971c09618 Reviewed-by: Kari Hautamäki <kari.hautamaki@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
13a8df4a87
commit
7d013de058
|
@ -255,14 +255,14 @@ The same declaration can also be given for C++-defined types. See
|
|||
\section2 ComponentBehavior
|
||||
|
||||
With this pragma you can restrict components defined in this file to only
|
||||
create objects within the context of the same file. This holds for inline
|
||||
create objects within their original context. This holds for inline
|
||||
components as well as Component elements explicitly or implicitly created
|
||||
as properties. If a component is bound to a file context, you can safely
|
||||
as properties. If a component is bound to its context, you can safely
|
||||
use IDs from the rest of the file within the component. Otherwise, the
|
||||
engine and the QML tooling cannot know in advance what type, if any, such
|
||||
IDs will resolve to at run time.
|
||||
|
||||
In order to bind the components to the file scope specify the \c{Bound}
|
||||
In order to bind the components to their context specify the \c{Bound}
|
||||
argument:
|
||||
|
||||
\qml
|
||||
|
@ -272,7 +272,7 @@ pragma ComponentBehavior: Bound
|
|||
The default is \c{Unbound}. You can also specify it explicitly. In a
|
||||
future version of Qt the default will change to \c{Bound}.
|
||||
|
||||
Delegate components bound to the file context don't receive their own
|
||||
Delegate components bound to their context don't receive their own
|
||||
private contexts on instantiation. This means that model data can only
|
||||
be passed via \l{Required Properties}{required properties} in this case.
|
||||
Passing model data via context properties will not work. This concerns
|
||||
|
|
Loading…
Reference in New Issue