Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/graphicsview/qgridlayoutengine_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    9090    Right,
    9191    Bottom
     92};
     93
     94enum {
     95    NoConstraint,
     96    HorizontalConstraint,   // Width depends on the height
     97    VerticalConstraint,     // Height depends on the width
     98    UnknownConstraint,      // need to update cache
     99    UnfeasibleConstraint    // not feasible, it be has some items with Vertical and others with Horizontal constraints
    92100};
    93101
     
    217225typedef QMap<QPair<int, int>, QGridLayoutMultiCellData> MultiCellMap;
    218226
     227class QGridLayoutRowInfo;
     228
    219229class QGridLayoutRowData
    220230{
    221231public:
    222232    void reset(int count);
    223     void distributeMultiCells();
     233    void distributeMultiCells(const QGridLayoutRowInfo &rowInfo);
    224234    void calculateGeometries(int start, int end, qreal targetSize, qreal *positions, qreal *sizes,
    225                              qreal *descents, const QGridLayoutBox &totalBox);
     235                             qreal *descents, const QGridLayoutBox &totalBox,
     236                             const QGridLayoutRowInfo &rowInfo);
    226237    QGridLayoutBox totalBox(int start, int end) const;
    227238    void stealBox(int start, int end, int which, qreal *positions, qreal *sizes);
     
    271282
    272283    QSizePolicy::Policy sizePolicy(Qt::Orientation orientation) const;
     284
     285    bool hasDynamicConstraint() const;
     286    Qt::Orientation dynamicConstraintOrientation() const;
     287
    273288    QSizePolicy::ControlTypes controlTypes(LayoutSide side) const;
    274289    QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
     
    281296    void transpose();
    282297    void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical);
    283     QSizeF effectiveMaxSize() const;
     298    QSizeF effectiveMaxSize(const QSizeF &constraint) const;
    284299
    285300#ifdef QT_DEBUG
     
    364379    inline void insertRow(int row, Qt::Orientation orientation = Qt::Vertical)
    365380        { insertOrRemoveRows(row, +1, orientation); }
    366     inline void removeRow(int row, Qt::Orientation orientation = Qt::Vertical)
    367         { insertOrRemoveRows(row, -1, orientation); }
     381    inline void removeRows(int row, int count, Qt::Orientation orientation)
     382        { insertOrRemoveRows(row, -count, orientation); }
    368383
    369384    void invalidate();
     
    373388    QSizeF sizeHint(const QLayoutStyleInfo &styleInfo, Qt::SizeHint which,
    374389                    const QSizeF &constraint) const;
     390
     391    // heightForWidth / widthForHeight support
     392    QSizeF dynamicallyConstrainedSizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
     393    bool ensureDynamicConstraint() const;
     394    bool hasDynamicConstraint() const;
     395    Qt::Orientation constraintOrientation() const;
     396
     397
    375398    QSizePolicy::ControlTypes controlTypes(LayoutSide side) const;
    376399    void transpose();
     
    391414    void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical);
    392415    void fillRowData(QGridLayoutRowData *rowData, const QLayoutStyleInfo &styleInfo,
    393                      Qt::Orientation orientation = Qt::Vertical) const;
     416                                    qreal *colPositions, qreal *colSizes,
     417                                    Qt::Orientation orientation = Qt::Vertical) const;
    394418    void ensureEffectiveFirstAndLastRows() const;
    395     void ensureColumnAndRowData(const QLayoutStyleInfo &styleInfo) const;
     419    void ensureColumnAndRowData(QGridLayoutRowData *rowData, QGridLayoutBox *totalBox,
     420                                            const QLayoutStyleInfo &styleInfo,
     421                                            qreal *colPositions, qreal *colSizes,
     422                                            Qt::Orientation orientation) const;
     423
    396424    void ensureGeometries(const QLayoutStyleInfo &styleInfo, const QSizeF &size) const;
    397425
     
    406434    mutable int q_cachedEffectiveFirstRows[NOrientations];
    407435    mutable int q_cachedEffectiveLastRows[NOrientations];
     436    mutable quint8 q_cachedConstraintOrientation : 3;
    408437
    409438    // Layout item input
Note: See TracChangeset for help on using the changeset viewer.