diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-06-01 06:27:59 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-06-02 00:07:33 (GMT) |
commit | 9cb0802cede5f9fd91ca303bcec5ae869acae951 (patch) | |
tree | f90d5fed5004dfa7e526783d81f94f04444313e4 /src/declarative/graphicsitems/qdeclarativepositioners.cpp | |
parent | 2e904930ede28a59710ef6f898419aba7ede7c06 (diff) | |
download | Qt-9cb0802cede5f9fd91ca303bcec5ae869acae951.zip Qt-9cb0802cede5f9fd91ca303bcec5ae869acae951.tar.gz Qt-9cb0802cede5f9fd91ca303bcec5ae869acae951.tar.bz2 |
Doc fixes and improvements - fix some example code, link to
examples from class docs and improve assorted docs
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepositioners.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepositioners.cpp | 101 |
1 files changed, 53 insertions, 48 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index 8796e63..20cc46b 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -302,7 +302,7 @@ void QDeclarativeBasePositioner::finishApplyTransitions() /*! \qmlclass Column QDeclarativeColumn \since 4.7 - \brief The Column item lines up its children vertically. + \brief The Column item arranges its children vertically. \inherits Item The Column item positions its child items so that they are vertically @@ -346,7 +346,8 @@ Column { will not change. If you manually change the x or y properties in script, bind the x or y properties, use anchors on a child of a positioner, or have the height of a child depend on the position of a child, then the - positioner may exhibit strange behaviour. + positioner may exhibit strange behaviour. If you need to perform any of these + actions, consider positioning the items without the use of a Column. */ /*! @@ -396,7 +397,7 @@ Column { spacing is the amount in pixels left empty between each adjacent item, and defaults to 0. - The below example places a Grid containing a red, a blue and a + The below example places a \l Grid containing a red, a blue and a green rectangle on a gray background. The area the grid positioner occupies is colored white. The top positioner has the default of no spacing, and the bottom positioner has its spacing set to 2. @@ -468,17 +469,15 @@ void QDeclarativeColumn::reportConflictingAnchors() /*! \qmlclass Row QDeclarativeRow \since 4.7 - \brief The Row item lines up its children horizontally. + \brief The Row item arranges its children horizontally. \inherits Item The Row item positions its child items so that they are - horizontally aligned and not overlapping. Spacing can be added between the - items, and a margin around all items can also be added. It also provides for - transitions to be set when items are added, moved, or removed in the - positioner. Adding and removing apply both to items which are deleted or have - their position in the document changed so as to no longer be children of the - positioner, as well as to items which have their opacity set to or from zero - so as to appear or disappear. + horizontally aligned and not overlapping. + + Use \l spacing to set the spacing between items in a Row, and use the + \l add and \l move properties to set the transitions that should be applied + when items are added to, removed from, or re-positioned within the Row. The below example lays out differently shaped rectangles using a Row. \qml @@ -495,8 +494,8 @@ Row { will not change. If you manually change the x or y properties in script, bind the x or y properties, use anchors on a child of a positioner, or have the width of a child depend on the position of a child, then the - positioner may exhibit strange behaviour. - + positioner may exhibit strange behaviour. If you need to perform any of these + actions, consider positioning the items without the use of a Row. */ /*! \qmlproperty Transition Row::add @@ -504,12 +503,10 @@ Row { The transition will only be applied to the added item(s). Positioner transitions will only affect the position (x,y) of items. - Added can mean that either the object has been created or - reparented, and thus is now a child or the positioner, or that the + An object is considered to be added to the positioner if it has been + created or reparented and thus is now a child or the positioner, or if the object has had its opacity increased from zero, and thus is now visible. - - */ /*! \qmlproperty Transition Row::move @@ -540,7 +537,7 @@ Row { spacing is the amount in pixels left empty between each adjacent item, and defaults to 0. - The below example places a Grid containing a red, a blue and a + The below example places a \l Grid containing a red, a blue and a green rectangle on a gray background. The area the grid positioner occupies is colored white. The top positioner has the default of no spacing, and the bottom positioner has its spacing set to 2. @@ -610,18 +607,20 @@ void QDeclarativeRow::reportConflictingAnchors() \inherits Item The Grid item positions its child items so that they are - aligned in a grid and are not overlapping. Spacing can be added - between the items. It also provides for transitions to be set when items are + aligned in a grid and are not overlapping. + + Spacing can be added + between child items. It also provides for transitions to be set when items are added, moved, or removed in the positioner. Adding and removing apply both to items which are deleted or have their position in the document changed so as to no longer be children of the positioner, as well as to items which have their opacity set to or from zero so as to appear or disappear. - The Grid defaults to using four columns, and as many rows as - are necessary to fit all the child items. The number of rows - and/or the number of columns can be constrained by setting the rows - or columns properties. The grid positioner calculates a grid with + A Grid defaults to four columns, and as many rows as + are necessary to fit all child items. The number of rows + and/or the number of columns can be constrained by setting the \l rows + or \l columns properties. The grid positioner calculates a grid with rectangular cells of sufficient size to hold all items, and then places the items in the cells, going across then down, and positioning each item at the (0,0) corner of the cell. The below @@ -648,7 +647,8 @@ Grid { will not change. If you manually change the x or y properties in script, bind the x or y properties, use anchors on a child of a positioner, or have the width or height of a child depend on the position of a child, then the - positioner may exhibit strange behaviour. + positioner may exhibit strange behaviour. If you need to perform any of these + actions, consider positioning the items without the use of a Grid. */ /*! \qmlproperty Transition Grid::add @@ -658,12 +658,10 @@ Grid { as that is all the positioners affect. To animate other property change you will have to do so based on how you have changed those properties. - Added can mean that either the object has been created or - reparented, and thus is now a child or the positioner, or that the + An object is considered to be added to the positioner if it has been + created or reparented and thus is now a child or the positioner, or if the object has had its opacity increased from zero, and thus is now visible. - - */ /*! \qmlproperty Transition Grid::move @@ -714,18 +712,16 @@ QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) : \qmlproperty int Grid::columns This property holds the number of columns in the grid. - When the columns property is set the Grid will always have - that many columns. Note that if you do not have enough items to - fill this many columns some columns will be of zero width. + If the grid does not have enough items to fill the specified + number of columns, some columns will be of zero width. */ /*! \qmlproperty int Grid::rows This property holds the number of rows in the grid. - When the rows property is set the Grid will always have that - many rows. Note that if you do not have enough items to fill this - many rows some rows will be of zero width. + If the grid does not have enough items to fill the specified + number of rows, some rows will be of zero width. */ void QDeclarativeGrid::setColumns(const int columns) @@ -750,12 +746,14 @@ void QDeclarativeGrid::setRows(const int rows) \qmlproperty enumeration Grid::flow This property holds the flow of the layout. - Possible values are \c Grid.LeftToRight (default) and \c Grid.TopToBottom. + Possible values are: - If \a flow is \c Grid.LeftToRight, the items are positioned next to - to each other from left to right, then wrapped to the next line. - If \a flow is \c Grid.TopToBottom, the items are positioned next to each - other from top to bottom, then wrapped to the next column. + \list + \o Grid.LeftToRight (default) - Items are positioned next to + to each other from left to right, then wrapped to the next line. + \o Grid.TopToBottom - Items are positioned next to each + other from top to bottom, then wrapped to the next column. + \endlist */ QDeclarativeGrid::Flow QDeclarativeGrid::flow() const { @@ -893,14 +891,18 @@ void QDeclarativeGrid::reportConflictingAnchors() /*! \qmlclass Flow QDeclarativeFlow \since 4.7 - \brief The Flow item lines up its children side by side, wrapping as necessary. + \brief The Flow item arranges its children side by side, wrapping as necessary. \inherits Item + The Flow item positions its child items so that they are side by side and are + not overlapping. + Note that the positioner assumes that the x and y positions of its children will not change. If you manually change the x or y properties in script, bind the x or y properties, use anchors on a child of a positioner, or have the width or height of a child depend on the position of a child, then the - positioner may exhibit strange behaviour. + positioner may exhibit strange behaviour. If you need to perform any of these + actions, consider positioning the items without the use of a Flow. */ /*! @@ -909,9 +911,10 @@ void QDeclarativeGrid::reportConflictingAnchors() The transition will only be applied to the added item(s). Positioner transitions will only affect the position (x,y) of items. - Added can mean that either the object has been created or reparented, and thus is now a child or the positioner, or that the object has had its opacity increased from zero, and thus is now visible. - - + An object is considered to be added to the positioner if it has been + created or reparented and thus is now a child or the positioner, or if the + object has had its opacity increased from zero, and thus is now + visible. */ /*! \qmlproperty Transition Flow::move @@ -965,14 +968,16 @@ QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent) \qmlproperty enumeration Flow::flow This property holds the flow of the layout. - Possible values are \c Flow.LeftToRight (default) and \c Flow.TopToBottom. + Possible values are: - If \a flow is \c Flow.LeftToRight, the items are positioned next to + \list + \o Flow.LeftToRight (default) - Items are positioned next to to each other from left to right until the width of the Flow is exceeded, then wrapped to the next line. - If \a flow is \c Flow.TopToBottom, the items are positioned next to each + \o Flow.TopToBottom - Items are positioned next to each other from top to bottom until the height of the Flow is exceeded, then wrapped to the next column. + \endlist */ QDeclarativeFlow::Flow QDeclarativeFlow::flow() const { |