/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
**
** This file is part of the documentation of the Qt Toolkit.
**
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page qmlreusablecomponents.html
+\inqmlmodule QtQuick 2
\ingroup qml-features
\previouspage {QML Signal and Handler Event System}{Signal and Handler Event System}
\nextpage {QML States}{States}
\title Importing Reusable Components
-A \e component is an instantiable QML definition, typically contained in a
-\c .qml file. For instance, a Button \e component may be defined in
+A \i component is an instantiable QML definition, typically contained in a
+\c .qml file. For instance, a Button \i component may be defined in
\c Button.qml. The QML runtime may instantiate this Button component to create
-Button \e objects. Alternatively, a component may be defined inside a
+Button \i objects. Alternatively, a component may be defined inside a
\l Component element.
Moreover, the Button definition may also contain other components. A Button
\keyword qml-top-level
\section1 Top-Level Component
-Choosing the \e{top-level} or the \e{root} object of components is an important
+Choosing the \i{top-level} or the \i{root} object of components is an important
design aspect because the top-level object dictates which properties are
accessible outside the component. Some elements are not visual elements and
will not have visual properties exposed outside the component. Likewise, some
to be exposed.
\snippet doc/src/snippets/declarative/reusablecomponents/focusbutton.qml document
-*/
+\section2 Child Components
+
+Objects or Items declared within a component can be made accessible by binding their id to a
+property alias.
+
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent begin
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml object alias
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml text
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent end
+
+The advantage of using an alias instead a property of type of the object is that the value of
+the alias cannot be overridden, and members of the object can be used in property bindings when
+declaring an instance of the component.
+\snippet doc/src/snippets/declarative/reusablecomponents/application.qml grouped property
+If a property of type \c Text was used instead of an alias in this instance there would be no
+guarantee that \c label would be initialized before the binding was attempted which would cause
+the binding to fail.
+*/