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

Method insertColumn

qcustomplot.cpp:4468–4484  ·  view source on GitHub ↗

! Inserts a new column with empty cells at the column index \a newIndex. Valid values for \a newIndex range from 0 (inserts a column at the left) to \a columnCount (appends a column at the right). \see insertRow */

Source from the content-addressed store, hash-verified

4466 \see insertRow
4467*/
4468void QCPLayoutGrid::insertColumn(int newIndex)
4469{
4470 if (mElements.isEmpty() || mElements.first().isEmpty()) // if grid is completely empty, add first cell
4471 {
4472 expandTo(1, 1);
4473 return;
4474 }
4475
4476 if (newIndex < 0)
4477 newIndex = 0;
4478 if (newIndex > columnCount())
4479 newIndex = columnCount();
4480
4481 mColumnStretchFactors.insert(newIndex, 1);
4482 for (int row=0; row<rowCount(); ++row)
4483 mElements[row].insert(newIndex, (QCPLayoutElement*)0);
4484}
4485
4486/*!
4487 Converts the given \a row and \a column to the linear index used by some methods of \ref

Callers 1

ScriptingWindowMethod · 0.80

Calls 4

columnCountFunction · 0.85
rowCountFunction · 0.85
insertMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected