QBoxLayout: Remove unconventional try/catch blocks
These appear in insertSpacing() and insertWidget() only and without any justification of why they may be needed. Several other instances of the pattern these try/catch blocks were guarding, i.e. allocate new QBoxLayoutItem and insert to the list of items, were left unguarded, leading us to believe this may not be useful at all and can be safely removed. Change-Id: I887fbde9d10e10f4f5daaa37f6f2892bd4038d58 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>bb10
parent
7bfe093ae5
commit
f874b6e995
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue