MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / insertRow

Method insertRow

qcustomplot/qcustomplot.cpp:4441–4459  ·  view source on GitHub ↗

! Inserts a new row with empty cells at the row index \a newIndex. Valid values for \a newIndex range from 0 (inserts a row at the top) to \a rowCount (appends a row at the bottom). \see insertColumn */

Source from the content-addressed store, hash-verified

4439 \see insertColumn
4440*/
4441void QCPLayoutGrid::insertRow(int newIndex)
4442{
4443 if (mElements.isEmpty() || mElements.first().isEmpty()) // if grid is completely empty, add first cell
4444 {
4445 expandTo(1, 1);
4446 return;
4447 }
4448
4449 if (newIndex < 0)
4450 newIndex = 0;
4451 if (newIndex > rowCount())
4452 newIndex = rowCount();
4453
4454 mRowStretchFactors.insert(newIndex, 1);
4455 QList<QCPLayoutElement*> newRow;
4456 for (int col=0; col<columnCount(); ++col)
4457 newRow.append((QCPLayoutElement*)0);
4458 mElements.insert(newIndex, newRow);
4459}
4460
4461/*!
4462 Inserts a new column with empty cells at the column index \a newIndex. Valid values for \a

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected