From d4dd08918082372d3df7be2d3a6671cbd7bc7fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 20 Oct 2009 15:52:56 +0200 Subject: Add some docs that explicitly mentions how we handle cycles in the tree This was reported for QGraphicsAnchorLayout, but affects all QGraphicsLayout subclasses. However, since it is not even handled properly in QGraphicsItem::setParentItem() it should be fine that we don't try to deal with this issue. Thus, the layouts are "consistent" with graphics items when it comes to detection of cycles in the tree. --- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 3 +++ src/gui/graphicsview/qgraphicsitem.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index c39e8a6..cb8ccc1 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -215,6 +215,9 @@ QGraphicsAnchorLayout::~QGraphicsAnchorLayout() The spacing can also be set manually by using QGraphicsAnchor::setSpacing() method. + Calling this function where \a firstItem or \a secondItem are ancestors of the layout have + undefined behaviour. + \sa addCornerAnchors(), addAnchors() */ QGraphicsAnchor * diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 45627f6..1ebee45 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1511,6 +1511,8 @@ const QGraphicsObject *QGraphicsItem::toGraphicsObject() const the parent. You should not \l{QGraphicsScene::addItem()}{add} the item to the scene yourself. + Calling this function on an item that is an ancestor of \a parent have undefined behaviour. + \sa parentItem(), childItems() */ void QGraphicsItem::setParentItem(QGraphicsItem *parent) -- cgit v0.12