summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-20 13:52:56 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-20 13:52:56 (GMT)
commitd4dd08918082372d3df7be2d3a6671cbd7bc7fd3 (patch)
tree4b17624d3a762f431f785e4ffac083152bd7e193
parent856efef9bf87e0b7e5ed6ad2ccb225e294321888 (diff)
downloadQt-d4dd08918082372d3df7be2d3a6671cbd7bc7fd3.zip
Qt-d4dd08918082372d3df7be2d3a6671cbd7bc7fd3.tar.gz
Qt-d4dd08918082372d3df7be2d3a6671cbd7bc7fd3.tar.bz2
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.
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp3
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
2 files changed, 5 insertions, 0 deletions
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)