Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qboxlayout.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    453453
    454454    \ingroup geomanagement
    455     \ingroup appearance
    456455
    457456    QBoxLayout takes the space it gets (from its parent layout or from
     
    528527    rather than QBoxLayout because of their convenient constructors.
    529528
    530     \sa QGridLayout, QStackedLayout, {Layout Classes}
     529    \sa QGridLayout, QStackedLayout, {Layout Management}
    531530*/
    532531
     
    832831            for (int i = 0; i < n; i++) {
    833832                QBoxLayoutItem *box = d->list.at(i);
    834                 if (box->item->hasHeightForWidth())
     833                if (box->item->hasHeightForWidth()) {
     834                    int width = qBound(box->item->minimumSize().width(), s.width(), box->item->maximumSize().width());
    835835                    a[i].sizeHint = a[i].minimumSize =
    836                                     box->item->heightForWidth(s.width());
     836                                    box->item->heightForWidth(width);
     837                }
    837838            }
    838839        }
     
    926927        b = QLayoutPrivate::createSpacerItem(this, 0, size, QSizePolicy::Minimum, QSizePolicy::Fixed);
    927928
    928     QBoxLayoutItem *it = new QBoxLayoutItem(b);
    929     it->magic = true;
    930     d->list.insert(index, it);
     929    QT_TRY {
     930        QBoxLayoutItem *it = new QBoxLayoutItem(b);
     931        it->magic = true;
     932        d->list.insert(index, it);
     933
     934    } QT_CATCH(...) {
     935        delete b;
     936        QT_RETHROW;
     937    }
    931938    invalidate();
    932939}
     
    10281035    QWidgetItem *b = QLayoutPrivate::createWidgetItem(this, widget);
    10291036    b->setAlignment(alignment);
    1030     QBoxLayoutItem *it = new QBoxLayoutItem(b, stretch);
    1031     d->list.insert(index, it);
     1037
     1038    QBoxLayoutItem *it;
     1039    QT_TRY{
     1040        it = new QBoxLayoutItem(b, stretch);
     1041    } QT_CATCH(...) {
     1042        delete b;
     1043        QT_RETHROW;
     1044    }
     1045
     1046    QT_TRY{
     1047        d->list.insert(index, it);
     1048    } QT_CATCH(...) {
     1049        delete it;
     1050        QT_RETHROW;
     1051    }
    10321052    invalidate();
    10331053}
     
    12721292
    12731293    \ingroup geomanagement
    1274     \ingroup appearance
    1275     \mainclass
    12761294
    12771295    This class is used to construct horizontal box layout objects. See
     
    12961314    \image qhboxlayout-with-5-children.png Horizontal box layout with five child widgets
    12971315
    1298     \sa QVBoxLayout, QGridLayout, QStackedLayout, {Layout Classes}, {Basic Layouts Example}
     1316    \sa QVBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example}
    12991317*/
    13001318
     
    13901408
    13911409    \ingroup geomanagement
    1392     \ingroup appearance
    1393     \mainclass
    13941410
    13951411    This class is used to construct vertical box layout objects. See
     
    14141430    \image qvboxlayout-with-5-children.png Horizontal box layout with five child widgets
    14151431
    1416     \sa QHBoxLayout, QGridLayout, QStackedLayout, {Layout Classes}, {Basic Layouts Example}
     1432    \sa QHBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example}
    14171433*/
    14181434
Note: See TracChangeset for help on using the changeset viewer.