MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / expandTo

Method expandTo

qcustomplot.cpp:4416–4433  ·  view source on GitHub ↗

! 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

Source from the content-addressed store, hash-verified

4414 \see simplify
4415*/
4416void 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

Callers

nothing calls this directly

Calls 5

rowCountFunction · 0.85
columnCountFunction · 0.85
appendMethod · 0.80
atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected