44 it !=
itemList.constEnd(); ++it, index++ )
63 setSpacing( spacing );
64 setContentsMargins( margin, margin, margin, margin );
74 setSpacing( spacing );
98 QLayout::invalidate();
224 QLayout::setGeometry( rect );
240 ( *it )->setGeometry( itemGeometries[index] );
271 if ( rowWidth > width )
300 colWidth[col] = qMax( colWidth[col],
304 const QMargins m = contentsMargins();
306 int rowWidth = m.left() + m.right() + (
numColumns - 1 ) * spacing();
308 rowWidth += colWidth[col];
345 uint numColumns )
const
349 return itemGeometries;
356 return itemGeometries;
363 bool expandH, expandV;
367 if ( expandH || expandV )
372 const QRect alignedRect = alignmentRect( rect );
375 const int xOffset = expandH ? 0 : alignedRect.x();
376 const int yOffset = expandV ? 0 : alignedRect.y();
381 const int xySpace = spacing();
383 const QMargins m = contentsMargins();
385 rowY[0] = yOffset + m.top();
386 for ( uint r = 1; r <
numRows; r++ )
387 rowY[r] = rowY[r - 1] + rowHeight[r - 1] + xySpace;
389 colX[0] = xOffset + m.left();
391 colX[c] = colX[c - 1] + colWidth[c - 1] + xySpace;
401 const QRect itemGeometry( colX[col], rowY[row],
402 colWidth[col], rowHeight[row] );
403 itemGeometries.append( itemGeometry );
406 return itemGeometries;
435 rowHeight[row] = ( col == 0 )
436 ?
size.height() : qMax( rowHeight[row],
size.height() );
437 colWidth[col] = ( row == 0 )
438 ?
size.width() : qMax( colWidth[col],
size.width() );
470 const QMargins m = contentsMargins();
472 int h = m.top() + m.bottom() + (
numRows - 1 ) * spacing();
473 for ( uint row = 0; row <
numRows; row++ )
497 bool expandH, expandV;
501 const QMargins m = contentsMargins();
505 int xDelta = rect.width() - m.left() - m.right() - (
numColumns - 1 ) * spacing();
507 xDelta -= colWidth[col];
513 const int space = xDelta / (
numColumns - col );
514 colWidth[col] += space;
526 int yDelta = rect.height() - m.top() - m.bottom() - (
numRows - 1 ) * spacing();
527 for ( uint row = 0; row <
numRows; row++ )
528 yDelta -= rowHeight[row];
532 for ( uint row = 0; row <
numRows; row++ )
534 const int space = yDelta / (
numRows - row );
535 rowHeight[row] += space;
568 const QMargins m = contentsMargins();
570 int h = m.top() + m.bottom() + (
numRows - 1 ) * spacing();
571 for ( uint row = 0; row <
numRows; row++ )
574 int w = m.left() + m.right() + (
numColumns - 1 ) * spacing();
578 return QSize( w, h );
602 #include "moc_qwt_dyngrid_layout.cpp"