summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qboxlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qboxlayout.cpp')
-rw-r--r--src/gui/kernel/qboxlayout.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/src/gui/kernel/qboxlayout.cpp b/src/gui/kernel/qboxlayout.cpp
index 50fe689..3f2a5dc 100644
--- a/src/gui/kernel/qboxlayout.cpp
+++ b/src/gui/kernel/qboxlayout.cpp
@@ -452,7 +452,6 @@ void QBoxLayoutPrivate::calcHfw(int w)
vertically.
\ingroup geomanagement
- \ingroup appearance
QBoxLayout takes the space it gets (from its parent layout or from
the parentWidget()), divides it up into a row of boxes, and makes
@@ -527,7 +526,7 @@ void QBoxLayoutPrivate::calcHfw(int w)
You will almost always want to use QVBoxLayout and QHBoxLayout
rather than QBoxLayout because of their convenient constructors.
- \sa QGridLayout, QStackedLayout, {Layout Classes}
+ \sa QGridLayout, QStackedLayout, {Layout Management}
*/
/*!
@@ -925,9 +924,15 @@ void QBoxLayout::insertSpacing(int index, int size)
else
b = QLayoutPrivate::createSpacerItem(this, 0, size, QSizePolicy::Minimum, QSizePolicy::Fixed);
- QBoxLayoutItem *it = new QBoxLayoutItem(b);
- it->magic = true;
- d->list.insert(index, it);
+ QT_TRY {
+ QBoxLayoutItem *it = new QBoxLayoutItem(b);
+ it->magic = true;
+ d->list.insert(index, it);
+
+ } QT_CATCH(...) {
+ delete b;
+ QT_RETHROW;
+ }
invalidate();
}
@@ -1027,8 +1032,21 @@ void QBoxLayout::insertWidget(int index, QWidget *widget, int stretch,
index = d->list.count();
QWidgetItem *b = QLayoutPrivate::createWidgetItem(this, widget);
b->setAlignment(alignment);
- QBoxLayoutItem *it = new QBoxLayoutItem(b, stretch);
- d->list.insert(index, it);
+
+ 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;
+ }
invalidate();
}
@@ -1271,8 +1289,6 @@ QBoxLayout::Direction QBoxLayout::direction() const
\brief The QHBoxLayout class lines up widgets horizontally.
\ingroup geomanagement
- \ingroup appearance
- \mainclass
This class is used to construct horizontal box layout objects. See
QBoxLayout for details.
@@ -1295,7 +1311,7 @@ QBoxLayout::Direction QBoxLayout::direction() const
\image qhboxlayout-with-5-children.png Horizontal box layout with five child widgets
- \sa QVBoxLayout, QGridLayout, QStackedLayout, {Layout Classes}, {Basic Layouts Example}
+ \sa QVBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example}
*/
@@ -1389,8 +1405,6 @@ QHBoxLayout::~QHBoxLayout()
\brief The QVBoxLayout class lines up widgets vertically.
\ingroup geomanagement
- \ingroup appearance
- \mainclass
This class is used to construct vertical box layout objects. See
QBoxLayout for details.
@@ -1413,7 +1427,7 @@ QHBoxLayout::~QHBoxLayout()
\image qvboxlayout-with-5-children.png Horizontal box layout with five child widgets
- \sa QHBoxLayout, QGridLayout, QStackedLayout, {Layout Classes}, {Basic Layouts Example}
+ \sa QHBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example}
*/
/*!