diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-10-20 15:58:42 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-11-16 09:33:59 +0000 |
commit | c71e8aadec7394cbf54fc6d79c3a7076c0c41a48 (patch) | |
tree | 305058bcaf61f7e249eda162321c8588d0999861 /src/qml/qml/v8 | |
parent | b35301f0b1ff88bf99ba1e88c4a14bc54431853d (diff) |
Document default argument behavior of Qt.createComponent()
It's not currently clear how to get the default mode when
also passing a parent, though lots of Qt code simply omits
the argument.
Change-Id: I35db7cf57991a2a3fafe4d00df2879b98037e93c
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/v8')
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index ca488021c8..f4e980eefb 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -1074,10 +1074,23 @@ If the optional \a mode parameter is set to \c Component.Asynchronous, the component will be loaded in a background thread. The Component::status property will be \c Component.Loading while it is loading. The status will change to \c Component.Ready if the component loads successfully, or \c Component.Error -if loading fails. +if loading fails. This parameter defaults to \c Component.PreferSynchronous +if omitted. + +If \a mode is set to \c Component.PreferSynchronous, Qt will attempt to load +the component synchronously, but may end up loading it asynchronously if +necessary. Scenarios that may cause asynchronous loading include, but are not +limited to, the following: + +\list +\li The URL refers to a network resource +\li The component is being created as a result of another component that is +being loaded asynchronously +\endlist If the optional \a parent parameter is given, it should refer to the object -that will become the parent for the created \l Component object. +that will become the parent for the created \l Component object. If no mode +was passed, this can be the second argument. Call \l {Component::createObject()}{Component.createObject()} on the returned component to create an object instance of the component. |