! Converts the given \a row and \a column to the linear index used by some methods of \ref QCPLayoutGrid and \ref QCPLayout. The way the cells are indexed depends on \ref setFillOrder. If it is \ref foRowsFirst, the indices increase left to right and then top to bottom. If it is \ref foColumnsFirst, the indices increase top to bottom and then left to right. For the returned index to
| 4522 | \see indexToRowCol |
| 4523 | */ |
| 4524 | int QCPLayoutGrid::rowColToIndex(int row, int column) const |
| 4525 | { |
| 4526 | if (row >= 0 && row < rowCount()) |
| 4527 | { |
| 4528 | if (column >= 0 && column < columnCount()) |
| 4529 | { |
| 4530 | switch (mFillOrder) |
| 4531 | { |
| 4532 | case foRowsFirst: return column*rowCount() + row; |
| 4533 | case foColumnsFirst: return row*columnCount() + column; |
| 4534 | } |
| 4535 | } else |
| 4536 | qDebug() << Q_FUNC_INFO << "row index out of bounds:" << row; |
| 4537 | } else |
| 4538 | qDebug() << Q_FUNC_INFO << "column index out of bounds:" << column; |
| 4539 | return 0; |
| 4540 | } |
| 4541 | |
| 4542 | /*! |
| 4543 | Converts the linear index to row and column indices and writes the result to \a row and \a |
nothing calls this directly
no test coverage detected