diff options
Diffstat (limited to 'src/widgets/kernel/qlayout.cpp')
-rw-r--r-- | src/widgets/kernel/qlayout.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index d3e5986103..e74f17b6f7 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -1175,13 +1175,12 @@ QLayoutItem *QLayout::replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOpt if (index == -1) return 0; + addChildWidget(to); QLayoutItem *newitem = new QWidgetItem(to); newitem->setAlignment(item->alignment()); QLayoutItem *r = d->replaceAt(index, newitem); if (!r) delete newitem; - else - addChildWidget(to); return r; } |