Changeset 846 for trunk/src/gui/graphicsview/qgridlayoutengine_p.h
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/graphicsview/qgridlayoutengine_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 90 90 Right, 91 91 Bottom 92 }; 93 94 enum { 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 92 100 }; 93 101 … … 217 225 typedef QMap<QPair<int, int>, QGridLayoutMultiCellData> MultiCellMap; 218 226 227 class QGridLayoutRowInfo; 228 219 229 class QGridLayoutRowData 220 230 { 221 231 public: 222 232 void reset(int count); 223 void distributeMultiCells( );233 void distributeMultiCells(const QGridLayoutRowInfo &rowInfo); 224 234 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); 226 237 QGridLayoutBox totalBox(int start, int end) const; 227 238 void stealBox(int start, int end, int which, qreal *positions, qreal *sizes); … … 271 282 272 283 QSizePolicy::Policy sizePolicy(Qt::Orientation orientation) const; 284 285 bool hasDynamicConstraint() const; 286 Qt::Orientation dynamicConstraintOrientation() const; 287 273 288 QSizePolicy::ControlTypes controlTypes(LayoutSide side) const; 274 289 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; … … 281 296 void transpose(); 282 297 void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical); 283 QSizeF effectiveMaxSize( ) const;298 QSizeF effectiveMaxSize(const QSizeF &constraint) const; 284 299 285 300 #ifdef QT_DEBUG … … 364 379 inline void insertRow(int row, Qt::Orientation orientation = Qt::Vertical) 365 380 { 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); } 368 383 369 384 void invalidate(); … … 373 388 QSizeF sizeHint(const QLayoutStyleInfo &styleInfo, Qt::SizeHint which, 374 389 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 375 398 QSizePolicy::ControlTypes controlTypes(LayoutSide side) const; 376 399 void transpose(); … … 391 414 void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical); 392 415 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; 394 418 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 396 424 void ensureGeometries(const QLayoutStyleInfo &styleInfo, const QSizeF &size) const; 397 425 … … 406 434 mutable int q_cachedEffectiveFirstRows[NOrientations]; 407 435 mutable int q_cachedEffectiveLastRows[NOrientations]; 436 mutable quint8 q_cachedConstraintOrientation : 3; 408 437 409 438 // Layout item input
Note:
See TracChangeset
for help on using the changeset viewer.