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/graphicsview/qgridlayoutengine.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    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
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5252
    5353#include <QtDebug>
     54
    5455
    5556QT_BEGIN_NAMESPACE
     
    7172{
    7273    Q_ASSERT(sumDesired != 0.0);
    73     return desired * ::pow(sumAvailable / sumDesired, desired / sumDesired);
     74    return desired * ow(sumAvailable / sumDesired, desired / sumDesired);
    7475}
    7576
     
    276277                            factors[i] = (stretch < 0) ? 1.0 : 0.0;
    277278                        } else {
    278                             factors[i] = (stretch < 0) ? sizes[i] : 0.0;                       
     279                            factors[i] = (stretch < 0) ? sizes[i] : 0.0;
    279280                        }
    280281                    } else if (stretch == sumStretches) {
     
    462463QGridLayoutItem::QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem *layoutItem,
    463464                                 int row, int column, int rowSpan, int columnSpan,
    464                                  Qt::Alignment alignment)
     465                                 Qt::Alignment alignment)
    465466    : q_engine(engine), q_layoutItem(layoutItem), q_alignment(alignment)
    466467{
     
    472473    q_stretches[Ver] = -1;
    473474
    474     q_engine->addItem(this);
     475    q_engine->);
    475476}
    476477
     
    616617        width = size.width();
    617618        height = size.height();
    618        
     619
    619620        Qt::Alignment align = q_engine->effectiveAlignment(this);
    620621        switch (align & Qt::AlignHorizontal_Mask) {
     
    718719{
    719720    count += delta;
    720    
     721
    721722    insertOrRemoveItems(stretches, row, delta);
    722723    insertOrRemoveItems(spacings, row, delta);
     
    938939}
    939940
    940 void QGridLayoutEngine::addItem(QGridLayoutItem *item)
     941/*!
     942    \internal
     943    The \a index is only used by QGraphicsLinearLayout to ensure that itemAt() reflects the order
     944    of visual arrangement. Strictly speaking it does not have to, but most people expect it to.
     945    (And if it didn't we would have to add itemArrangedAt(int index) or something..)
     946 */
     947void QGridLayoutEngine::insertItem(QGridLayoutItem *item, int index)
    941948{
    942949    maybeExpandGrid(item->lastRow(), item->lastColumn());
    943950
    944     q_items.append(item);
     951    if (index == -1)
     952        q_items.append(item);
     953    else
     954        q_items.insert(index, item);
    945955
    946956    for (int i = item->firstRow(); i <= item->lastRow(); ++i) {
     
    951961        }
    952962    }
     963
     964
     965
     966
     967
    953968}
    954969
     
    10771092    }
    10781093    return QSizeF();
    1079 } 
     1094}
    10801095
    10811096QSizePolicy::ControlTypes QGridLayoutEngine::controlTypes(LayoutSide side) const
     
    11321147        for (int column = 0; column < internalGridColumnCount(); ++column) {
    11331148            message += QString::number(q_items.indexOf(itemAt(row, column))).rightJustified(3);
    1134             message += QLatin1String(" ");
    1135         }
    1136         message += QLatin1String("]");
     1149            message += QLatin1);
     1150        }
     1151        message += QLatin1);
    11371152        qDebug("%*s  %s", indent, "", qPrintable(message));
    11381153    }
     
    11511166
    11521167    qDebug("%*s Geometries output", indent, "");
     1168
    11531169    for (int pass = 0; pass < 2; ++pass) {
    1154         QVector<qreal> &cellPos = q_yy;
    11551170        QString message;
    1156         for (i = 0; i < cellPos.count(); ++i) {
     1171        for (i = 0; i < cellPoscount(); ++i) {
    11571172            message += QLatin1String((message.isEmpty() ? "[" : ", "));
    1158             message += QString::number(cellPos.at(i));
    1159         }
    1160         message += QLatin1String("]");
     1173            message += QString::number(cellPosat(i));
     1174        }
     1175        message += QLatin1);
    11611176        qDebug("%*s %s %s", indent, "", (pass == 0 ? "rows:" : "columns:"), qPrintable(message));
    1162         cellPos = q_xx;
     1177        cellPos = q_xx;
    11631178    }
    11641179}
     
    15391554
    15401555QT_END_NAMESPACE
    1541        
     1556
    15421557#endif //QT_NO_GRAPHICSVIEW
Note: See TracChangeset for help on using the changeset viewer.