summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsgridlayout.cpp
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-19 07:39:30 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-19 07:39:30 (GMT)
commit856efef9bf87e0b7e5ed6ad2ccb225e294321888 (patch)
tree452563793f599fd457b2558e74561a864d5285af /src/gui/graphicsview/qgraphicsgridlayout.cpp
parent6f20e48d946fa3c90215f6affe5aa490559a6971 (diff)
downloadQt-856efef9bf87e0b7e5ed6ad2ccb225e294321888.zip
Qt-856efef9bf87e0b7e5ed6ad2ccb225e294321888.tar.gz
Qt-856efef9bf87e0b7e5ed6ad2ccb225e294321888.tar.bz2
Do not loop forever if we are adding the layout itself to the layout.
Reviewed-by: alexis
Diffstat (limited to 'src/gui/graphicsview/qgraphicsgridlayout.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsgridlayout.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp
index eef4e45..9a8dba0 100644
--- a/src/gui/graphicsview/qgraphicsgridlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp
@@ -154,6 +154,10 @@ void QGraphicsGridLayout::addItem(QGraphicsLayoutItem *item, int row, int column
qWarning("QGraphicsGridLayout::addItem: cannot add null item");
return;
}
+ if (item == this) {
+ qWarning("QGraphicsGridLayout::addItem: cannot insert itself");
+ return;
+ }
d->addChildLayoutItem(item);