From b38395d12d6efc288fb260b10f3f1d2dc039c3b7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 13 Jul 2016 15:59:49 +0200 Subject: Doc: special notes for Component and url in StackView::push/replace() Adapted from Component::createObject() docs. Change-Id: I53e44cfbcb4e4f1cc407e09d4ee90724526c9411 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickstackview.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/quicktemplates2/qquickstackview.cpp') diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp index 632879f5..8cb06d06 100644 --- a/src/quicktemplates2/qquickstackview.cpp +++ b/src/quicktemplates2/qquickstackview.cpp @@ -399,6 +399,14 @@ QQuickItem *QQuickStackView::find(const QJSValue &callback, LoadBehavior behavio an \l Item, \l Component, or a \l [QML] url. Returns the item that became current. + StackView creates an instance automatically if the pushed item is a \l Component, + or a \l [QML] url. The optional \a properties argument specifies a map of initial + property values for the pushed item. For dynamically created items, these values + are applied before the creation is finalized. This is more efficient than setting + property values after creation, particularly where large sets of property values + are defined, and also allows property bindings to be set up (using \l{Qt::binding} + {Qt.binding()}) before the item is created. + Pushing a single item: \code stackView.push(rect) @@ -575,6 +583,14 @@ void QQuickStackView::pop(QQmlV4Function *args) item will be replaced. If \a target is \c null, all items in the stack will be replaced. If not specified, only the top item will be replaced. + StackView creates an instance automatically if the replacing item is a \l Component, + or a \l [QML] url. The optional \a properties argument specifies a map of initial + property values for the replacing item. For dynamically created items, these values + are applied before the creation is finalized. This is more efficient than setting + property values after creation, particularly where large sets of property values + are defined, and also allows property bindings to be set up (using \l{Qt::binding} + {Qt.binding()}) before the item is created. + Replace the top item: \code stackView.replace(rect) -- cgit v1.2.3