summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qformlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qformlayout.cpp')
-rw-r--r--src/gui/kernel/qformlayout.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp
index 0cbb9fa..9e481ec 100644
--- a/src/gui/kernel/qformlayout.cpp
+++ b/src/gui/kernel/qformlayout.cpp
@@ -1410,6 +1410,13 @@ QLayoutItem *QFormLayout::takeAt(int index)
QLayoutItem *i = item->item;
item->item = 0;
delete item;
+
+ if (QLayout *l = i->layout()) {
+ // sanity check in case the user passed something weird to QObject::setParent()
+ if (l->parent() == this)
+ l->setParent(0);
+ }
+
return i;
}