summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgridlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qgridlayout.cpp')
-rw-r--r--src/gui/kernel/qgridlayout.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qgridlayout.cpp b/src/gui/kernel/qgridlayout.cpp
index c9550de..731d5cd9 100644
--- a/src/gui/kernel/qgridlayout.cpp
+++ b/src/gui/kernel/qgridlayout.cpp
@@ -1609,7 +1609,8 @@ void QGridLayout::addWidget(QWidget *widget, int fromRow, int fromColumn,
void QGridLayout::addLayout(QLayout *layout, int row, int column, Qt::Alignment alignment)
{
Q_D(QGridLayout);
- addChildLayout(layout);
+ if (!adoptLayout(layout))
+ return;
QGridBox *b = new QGridBox(layout);
b->setAlignment(alignment);
d->add(b, row, column);
@@ -1628,7 +1629,8 @@ void QGridLayout::addLayout(QLayout *layout, int row, int column,
int rowSpan, int columnSpan, Qt::Alignment alignment)
{
Q_D(QGridLayout);
- addChildLayout(layout);
+ if (!adoptLayout(layout))
+ return;
QGridBox *b = new QGridBox(layout);
b->setAlignment(alignment);
d->add(b, row, (rowSpan < 0) ? -1 : row + rowSpan - 1, column, (columnSpan < 0) ? -1 : column + columnSpan - 1);