Changeset 561 for trunk/src/gui/graphicsview/qgridlayoutengine.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/graphicsview/qgridlayoutengine.cpp
r2 r561 2 2 ** 3 3 ** 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]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 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. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 52 52 53 53 #include <QtDebug> 54 54 55 55 56 QT_BEGIN_NAMESPACE … … 71 72 { 72 73 Q_ASSERT(sumDesired != 0.0); 73 return desired * ::pow(sumAvailable / sumDesired, desired / sumDesired);74 return desired * ow(sumAvailable / sumDesired, desired / sumDesired); 74 75 } 75 76 … … 276 277 factors[i] = (stretch < 0) ? 1.0 : 0.0; 277 278 } else { 278 factors[i] = (stretch < 0) ? sizes[i] : 0.0; 279 factors[i] = (stretch < 0) ? sizes[i] : 0.0; 279 280 } 280 281 } else if (stretch == sumStretches) { … … 462 463 QGridLayoutItem::QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem *layoutItem, 463 464 int row, int column, int rowSpan, int columnSpan, 464 Qt::Alignment alignment )465 Qt::Alignment alignment) 465 466 : q_engine(engine), q_layoutItem(layoutItem), q_alignment(alignment) 466 467 { … … 472 473 q_stretches[Ver] = -1; 473 474 474 q_engine-> addItem(this);475 q_engine->); 475 476 } 476 477 … … 616 617 width = size.width(); 617 618 height = size.height(); 618 619 619 620 Qt::Alignment align = q_engine->effectiveAlignment(this); 620 621 switch (align & Qt::AlignHorizontal_Mask) { … … 718 719 { 719 720 count += delta; 720 721 721 722 insertOrRemoveItems(stretches, row, delta); 722 723 insertOrRemoveItems(spacings, row, delta); … … 938 939 } 939 940 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 */ 947 void QGridLayoutEngine::insertItem(QGridLayoutItem *item, int index) 941 948 { 942 949 maybeExpandGrid(item->lastRow(), item->lastColumn()); 943 950 944 q_items.append(item); 951 if (index == -1) 952 q_items.append(item); 953 else 954 q_items.insert(index, item); 945 955 946 956 for (int i = item->firstRow(); i <= item->lastRow(); ++i) { … … 951 961 } 952 962 } 963 964 965 966 967 953 968 } 954 969 … … 1077 1092 } 1078 1093 return QSizeF(); 1079 } 1094 } 1080 1095 1081 1096 QSizePolicy::ControlTypes QGridLayoutEngine::controlTypes(LayoutSide side) const … … 1132 1147 for (int column = 0; column < internalGridColumnCount(); ++column) { 1133 1148 message += QString::number(q_items.indexOf(itemAt(row, column))).rightJustified(3); 1134 message += QLatin1 String(" ");1135 } 1136 message += QLatin1 String("]");1149 message += QLatin1); 1150 } 1151 message += QLatin1); 1137 1152 qDebug("%*s %s", indent, "", qPrintable(message)); 1138 1153 } … … 1151 1166 1152 1167 qDebug("%*s Geometries output", indent, ""); 1168 1153 1169 for (int pass = 0; pass < 2; ++pass) { 1154 QVector<qreal> &cellPos = q_yy;1155 1170 QString message; 1156 for (i = 0; i < cellPos .count(); ++i) {1171 for (i = 0; i < cellPoscount(); ++i) { 1157 1172 message += QLatin1String((message.isEmpty() ? "[" : ", ")); 1158 message += QString::number(cellPos .at(i));1159 } 1160 message += QLatin1 String("]");1173 message += QString::number(cellPosat(i)); 1174 } 1175 message += QLatin1); 1161 1176 qDebug("%*s %s %s", indent, "", (pass == 0 ? "rows:" : "columns:"), qPrintable(message)); 1162 cellPos = q_xx;1177 cellPos = q_xx; 1163 1178 } 1164 1179 } … … 1539 1554 1540 1555 QT_END_NAMESPACE 1541 1556 1542 1557 #endif //QT_NO_GRAPHICSVIEW
Note:
See TracChangeset
for help on using the changeset viewer.