MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / rowColToIndex

Method rowColToIndex

3rdparty/qcustomplot/qcustomplot.cpp:4524–4540  ·  view source on GitHub ↗

! 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

Source from the content-addressed store, hash-verified

4522 \see indexToRowCol
4523*/
4524int 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

Callers

nothing calls this directly

Calls 2

rowCountFunction · 0.85
columnCountFunction · 0.85

Tested by

no test coverage detected