diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-12-14 17:42:19 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-12-14 17:42:25 (GMT) |
commit | 463cd4f6563dc12d8b45bf2e293dc64d583e132c (patch) | |
tree | 1d1a6123f42fe8843f32c572cd3d1c4fb42aefcd /src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | |
parent | 4879551f72a377e0816164ce1762eb646839f4a6 (diff) | |
parent | 0295f8da10d6c920511d09f9e506b8bed8c444c3 (diff) | |
download | Qt-463cd4f6563dc12d8b45bf2e293dc64d583e132c.zip Qt-463cd4f6563dc12d8b45bf2e293dc64d583e132c.tar.gz Qt-463cd4f6563dc12d8b45bf2e293dc64d583e132c.tar.bz2 |
Merge commit oslo-staging-2/4.6 into upstream/4.6
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 03ed63d..1dc6873 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -1666,6 +1666,13 @@ QGraphicsAnchor *QGraphicsAnchorLayoutPrivate::addAnchor(QGraphicsLayoutItem *fi return 0; } + const QGraphicsLayoutItem *parentWidget = q->parentLayoutItem(); + if (firstItem == parentWidget || secondItem == parentWidget) { + qWarning("QGraphicsAnchorLayout::addAnchor(): " + "You cannot add the parent of the layout to the layout."); + return 0; + } + // In QGraphicsAnchorLayout, items are represented in its internal // graph as four anchors that connect: // - Left -> HCenter |