diff options
author | axis <qt-info@nokia.com> | 2009-10-27 08:32:25 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-10-27 08:32:25 (GMT) |
commit | 51bfafed59d77b791f0266fa1bfc36634597c5c4 (patch) | |
tree | 630d9fbc5aad375950b03d80cf775c228f31a741 /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | cb3a2633bb9d8a0e949c403d0f0631caef254599 (diff) | |
parent | 5a4909d9f87b9abf471908a085c0e9f31b7e0a50 (diff) | |
download | Qt-51bfafed59d77b791f0266fa1bfc36634597c5c4.zip Qt-51bfafed59d77b791f0266fa1bfc36634597c5c4.tar.gz Qt-51bfafed59d77b791f0266fa1bfc36634597c5c4.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 97979e5..edd2d7c 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1228,7 +1228,8 @@ void QGraphicsItemCache::purge() } /*! - Constructs a QGraphicsItem with the given \a parent. + Constructs a QGraphicsItem, passing \a item to QGraphicsItem's constructor. + It does not modify the parent object returned by QObject::parent(). If \a parent is 0, you can add the item to a scene by calling QGraphicsScene::addItem(). The item will then become a top-level item. @@ -7283,6 +7284,21 @@ static void qt_graphicsItem_highlightSelected( The class extends a QGraphicsItem with QObject's signal/slot and property mechanisms. It maps many of QGraphicsItem's basic setters and getters to properties and adds notification signals for many of them. + + \section1 Parents and Children + + Each graphics object can be constructed with a parent item. This ensures that the + item will be destroyed when its parent item is destroyed. Although QGraphicsObject + inherits from both QObject and QGraphicsItem, you should use the functions provided + by QGraphicsItem, \e not QObject, to manage the relationships between parent and + child items. + + The relationships between items can be explored using the parentItem() and childItems() + functions. In the hierarchy of items in a scene, the parentObject() and parentWidget() + functions are the equivalent of the QWidget::parent() and QWidget::parentWidget() + functions for QWidget subclasses. + + \sa QGraphicsWidget */ /*! @@ -7320,6 +7336,9 @@ void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureContext co \property QGraphicsObject::parent \brief the parent of the item + \note The item's parent is set independently of the parent object returned + by QObject::parent(). + \sa QGraphicsItem::setParentItem(), QGraphicsItem::parentObject() */ |