! Returns the element in the cell in \a row and \a column. Returns \c nullptr if either the row/column is invalid or if the cell is empty. In those cases, a qDebug message is printed. To check whether a cell exists and isn't empty, use \ref hasElement. \see addElement, hasElement */
| 4125 | \see addElement, hasElement |
| 4126 | */ |
| 4127 | QCPLayoutElement *QCPLayoutGrid::element(int row, int column) const |
| 4128 | { |
| 4129 | if (row >= 0 && row < mElements.size()) |
| 4130 | { |
| 4131 | if (column >= 0 && column < mElements.first().size()) |
| 4132 | { |
| 4133 | if (QCPLayoutElement *result = mElements.at(row).at(column)) |
| 4134 | return result; |
| 4135 | else |
| 4136 | qDebug() << Q_FUNC_INFO << "Requested cell is empty. Row:" << row << "Column:" << column; |
| 4137 | } else |
| 4138 | qDebug() << Q_FUNC_INFO << "Invalid column. Row:" << row << "Column:" << column; |
| 4139 | } else |
| 4140 | qDebug() << Q_FUNC_INFO << "Invalid row. Row:" << row << "Column:" << column; |
| 4141 | return nullptr; |
| 4142 | } |
| 4143 | |
| 4144 | |
| 4145 | /*! \overload |