aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-01-30 10:43:59 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-31 07:06:25 +0100
commit15b232bf694fedf553abac09af077a58ce571f9d (patch)
tree00f3a44dc551fdd5dd0976cf14a41d07e7064266
parentd005c5c80b6fff835adb350a780d80348549bc64 (diff)
Document QQuickItem::itemChange and QQuickItem::window() properly
Change-Id: Ic0e50ae8760c0c3050db3a095b0fa86679a0c010 Reviewed-by: Alan Alpert <aalpert@rim.com>
-rw-r--r--src/quick/items/qquickitem.cpp90
1 files changed, 87 insertions, 3 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 08f60aeb1e..d72a7b1a1d 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -1686,15 +1686,91 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus)
/*!
\enum QQuickItem::ItemChange
- \internal
+ \brief Used in conjunction with QQuickItem::itemChange() to notify
+ the item about certain types of changes.
+
+ \value ItemChildAddedChange A child was added. ItemChangeData::item contains
+ the added child.
+
+ \value ItemChildRemovedChange A child was removed. ItemChangeData::item
+ contains the removed child.
+
+ \value ItemSceneChange The item was added to or removed from a scene. The
+ QQuickWindow rendering the scene is specified in using ItemChangeData::window.
+ The window parameter is null when the item is removed from a scene.
+
+ \value ItemVisibleHasChanged The item's visibility has changed.
+ ItemChangeData::boolValue contains the new visibility.
+
+ \value ItemParentHasChanged The item's parent has changed.
+ ItemChangeData::item contains the new parent.
+
+ \value ItemOpacityHasChanged The item's opacity has changed.
+ ItemChangeData::realValue contains the new opacity.
+
+ \value ItemActiveFocusHasChanged The item's focus has changed.
+ ItemChangeData::boolValue contains whether the item has focus or not.
+
+ \value ItemRotationHasChanged The item's rotation has changed.
+ ItemChangeData::realValue contains the new rotation.
*/
/*!
\class QQuickItem::ItemChangeData
- \internal
+ \inmodule QtQuick
+ \brief Adds supplimentary information to the QQuickItem::itemChange()
+ function.
+
+ The meaning of each member of this class is defined by the change type.
+
+ \sa QQuickItem::ItemChange
*/
/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(QQuickItem *)
+ \internal
+ */
+
+/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(QQuickWindow *)
+ \internal
+ */
+
+/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(qreal)
+ \internal
+ */
+
+/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(bool)
+ \internal
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::realValue
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::boolValue
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::item
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::window
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
\enum QQuickItem::TransformOrigin
Controls the point about which simple transforms like scale apply.
@@ -2141,6 +2217,11 @@ void QQuickItem::stackAfter(const QQuickItem *sibling)
/*!
Returns the window in which this item is rendered.
+
+ The item does not have a window until it has been assigned into a scene. To
+ get notification about this, reimplement the itemChange() function and
+ listen for the ItemSceneChange change. The itemChange() function is called
+ both when the item is entered into a scene and when it is removed from a scene.
*/
QQuickWindow *QQuickItem::window() const
{
@@ -4170,7 +4251,10 @@ void QQuickItemPrivate::deliverDragEvent(QEvent *e)
#endif // QT_NO_DRAGANDDROP
/*!
- \internal
+ Called when \a change occurs for this item.
+
+ \a value contains extra information relating to the change, when
+ applicable.
*/
void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value)
{