! Expands the layout to have \a newRowCount rows and \a newColumnCount columns. So the last valid row index will be \a newRowCount-1, the last valid column index will be \a newColumnCount-1. If the current column/row count is already larger or equal to \a newColumnCount/\a newRowCount, this function does nothing in that dimension. Newly created cells are empty, new rows and columns
| 4414 | \see simplify |
| 4415 | */ |
| 4416 | void QCPLayoutGrid::expandTo(int newRowCount, int newColumnCount) |
| 4417 | { |
| 4418 | // add rows as necessary: |
| 4419 | while (rowCount() < newRowCount) |
| 4420 | { |
| 4421 | mElements.append(QList<QCPLayoutElement*>()); |
| 4422 | mRowStretchFactors.append(1); |
| 4423 | } |
| 4424 | // go through rows and expand columns as necessary: |
| 4425 | int newColCount = qMax(columnCount(), newColumnCount); |
| 4426 | for (int i=0; i<rowCount(); ++i) |
| 4427 | { |
| 4428 | while (mElements.at(i).size() < newColCount) |
| 4429 | mElements[i].append(0); |
| 4430 | } |
| 4431 | while (mColumnStretchFactors.size() < newColCount) |
| 4432 | mColumnStretchFactors.append(1); |
| 4433 | } |
| 4434 | |
| 4435 | /*! |
| 4436 | Inserts a new row with empty cells at the row index \a newIndex. Valid values for \a newIndex |
nothing calls this directly
no test coverage detected