aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-04-25 11:16:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-26 12:57:03 +0200
commitd5e612fb3e9753c762b741d135fabd2b1f8ae1a6 (patch)
treee355cbe7bf1fba9a3841f3cf1e1f95d90b5145b5 /src/quick/items/qquickitem.cpp
parent1230977b001caf71725afde88d6bdcc978dfe485 (diff)
Re-implemented itemChange must always call QQuickItem::itemChange
Documentation for that fact, and the windowChanged signal. Fix existing QQuickItem subclasses which didn't call QQuickItem::itemChange. Examples should rather connect to the windowChanged() signal. Change-Id: Ieddcdbe69f849ddb120b64be9c5e0a21393b0ed9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r--src/quick/items/qquickitem.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 44d11ac7ca..111e74eeff 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2346,13 +2346,16 @@ void QQuickItem::stackAfter(const QQuickItem *sibling)
QQuickItemPrivate::get(parentPrivate->childItems.at(ii))->siblingOrderChanged();
}
+/*! \fn void QQuickItem::windowChanged(QQuickWindow *window)
+ This signal is emitted when the item's \a window changes.
+*/
+
/*!
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.
+ The item does not have a window until it has been assigned into a scene. The
+ \l windowChanged signal provides a notification both when the item is entered
+ into a scene and when it is removed from a scene.
*/
QQuickWindow *QQuickItem::window() const
{
@@ -4457,6 +4460,13 @@ void QQuickItemPrivate::deliverDragEvent(QEvent *e)
\a value contains extra information relating to the change, when
applicable.
+
+ If you re-implement this method in a subclass, be sure to call
+ \code
+ QQuickItem::itemChange(change, value);
+ \endcode
+ typically at the end of your implementation, to ensure the
+ \l windowChanged signal will be emitted.
*/
void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value)
{