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/qlayout.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**
     
    6262        if (result != -1)
    6363            return result;
    64         result = menubar->sizeHint().height();
     64        result = menubar->sizeHint()
     65            .expandedTo(menubar->minimumSize())
     66            .expandedTo(menubar->minimumSizeHint())
     67            .boundedTo(menubar->maximumSize()).height();
    6568        if (result != -1)
    6669            return result;
     
    7376    \brief The QLayout class is the base class of geometry managers.
    7477
    75     \ingroup appearance
    7678    \ingroup geomanagement
    7779
     
    8183    For users of QLayout subclasses or of QMainWindow there is seldom
    8284    any need to use the basic functions provided by QLayout, such as
    83     setSizeConstraint() or setMenuBar(). See \l{Layout Classes}
     85    setSizeConstraint() or setMenuBar(). See \l{Layout Management}
    8486    for more information.
    8587
     
    9698    Geometry management stops when the layout manager is deleted.
    9799
    98     \sa QLayoutItem, {Layout Classes}, {Basic Layouts Example},
     100    \sa QLayoutItem, {Layout Management}, {Basic Layouts Example},
    99101        {Border Layout Example}, {Flow Layout Example}
    100102*/
     
    146148            d->topLevel = true;
    147149            w->d_func()->layout = this;
    148             invalidate();
     150            QT_TRY {
     151                invalidate();
     152            } QT_CATCH(...) {
     153                w->d_func()->layout = 0;
     154                QT_RETHROW;
     155            }
    149156        }
    150157    }
     
    231238            d->topLevel = true;
    232239            parent->d_func()->layout = this;
    233             invalidate();
     240            QT_TRY {
     241                invalidate();
     242            } QT_CATCH(...) {
     243                parent->d_func()->layout = 0;
     244                QT_RETHROW;
     245            }
    234246        }
    235247    }
     
    485497
    486498/*!
     499    \since 4.6
     500
     501    Sets the \a margins to use around the layout.
     502
     503    By default, QLayout uses the values provided by the style. On
     504    most platforms, the margin is 11 pixels in all directions.
     505
     506    \sa contentsMargins()
     507*/
     508void QLayout::setContentsMargins(const QMargins &margins)
     509{
     510    setContentsMargins(margins.left(), margins.top(), margins.right(), margins.bottom());
     511}
     512
     513/*!
    487514    \since 4.3
    488515
     
    507534    d->getMargin(right, d->userRightMargin, QStyle::PM_LayoutRightMargin);
    508535    d->getMargin(bottom, d->userBottomMargin, QStyle::PM_LayoutBottomMargin);
     536}
     537
     538/*!
     539    \since 4.6
     540
     541    Returns the margins used around the layout.
     542
     543    By default, QLayout uses the values provided by the style. On
     544    most platforms, the margin is 11 pixels in all directions.
     545
     546    \sa setContentsMargins()
     547*/
     548QMargins QLayout::contentsMargins() const
     549{
     550    int left, top, right, bottom;
     551    getContentsMargins(&left, &top, &right, &bottom);
     552    return QMargins(left, top, right, bottom);
    509553}
    510554
     
    10291073{
    10301074    Q_D(QLayout);
    1031     if (widget)
    1032         addChildWidget(widget);
     1075
     1076#ifdef Q_OS_WINCE_WM
     1077    if (widget && widget->size().height() > 0)
     1078#else
     1079        if (widget)
     1080#endif
     1081            addChildWidget(widget);
    10331082    d->menubar = widget;
    10341083}
     
    12401289    index from the layout, and return the item. If there is no such
    12411290    item, the function must do nothing and return 0.  Items are numbered
    1242     consecutively from 0. If an item is deleted, other items will be
     1291    consecutively from 0. If an item is removed, other items will be
    12431292    renumbered.
    12441293
     
    15791628    return stream >> policy.data;
    15801629}
    1581 
    1582 #endif
    1583 
     1630#endif // QT_NO_DATASTREAM
    15841631
    15851632QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.