diff options
Diffstat (limited to 'src/widgets/kernel/qboxlayout.cpp')
-rw-r--r-- | src/widgets/kernel/qboxlayout.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp index f2e3df5314..588cec2b95 100644 --- a/src/widgets/kernel/qboxlayout.cpp +++ b/src/widgets/kernel/qboxlayout.cpp @@ -873,15 +873,9 @@ void QBoxLayout::insertSpacing(int index, int size) else b = QLayoutPrivate::createSpacerItem(this, 0, size, QSizePolicy::Minimum, QSizePolicy::Fixed); - QT_TRY { - QBoxLayoutItem *it = new QBoxLayoutItem(b); - it->magic = true; - d->list.insert(index, it); - - } QT_CATCH(...) { - delete b; - QT_RETHROW; - } + QBoxLayoutItem *it = new QBoxLayoutItem(b); + it->magic = true; + d->list.insert(index, it); invalidate(); } @@ -985,20 +979,8 @@ void QBoxLayout::insertWidget(int index, QWidget *widget, int stretch, QWidgetItem *b = QLayoutPrivate::createWidgetItem(this, widget); b->setAlignment(alignment); - QBoxLayoutItem *it; - QT_TRY{ - it = new QBoxLayoutItem(b, stretch); - } QT_CATCH(...) { - delete b; - QT_RETHROW; - } - - QT_TRY{ - d->list.insert(index, it); - } QT_CATCH(...) { - delete it; - QT_RETHROW; - } + QBoxLayoutItem *it = new QBoxLayoutItem(b, stretch); + d->list.insert(index, it); invalidate(); } |