! 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 */
| 4491 | \see insertRow |
| 4492 | */ |
| 4493 | void QCPLayoutGrid::insertColumn(int newIndex) |
| 4494 | { |
| 4495 | if (mElements.isEmpty() || mElements.first().isEmpty()) // if grid is completely empty, add first cell |
| 4496 | { |
| 4497 | expandTo(1, 1); |
| 4498 | return; |
| 4499 | } |
| 4500 | |
| 4501 | if (newIndex < 0) |
| 4502 | newIndex = 0; |
| 4503 | if (newIndex > columnCount()) |
| 4504 | newIndex = columnCount(); |
| 4505 | |
| 4506 | mColumnStretchFactors.insert(newIndex, 1); |
| 4507 | for (int row=0; row<rowCount(); ++row) |
| 4508 | mElements[row].insert(newIndex, nullptr); |
| 4509 | } |
| 4510 | |
| 4511 | /*! |
| 4512 | Converts the given \a row and \a column to the linear index used by some methods of \ref |
nothing calls this directly
no test coverage detected