! 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 */
| 4439 | \see insertColumn |
| 4440 | */ |
| 4441 | void 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 |
nothing calls this directly
no test coverage detected