! Returns the element in the cell in \a row and \a column. Returns 0 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 */
| 4100 | \see addElement, hasElement |
| 4101 | */ |
| 4102 | QCPLayoutElement *QCPLayoutGrid::element(int row, int column) const |
| 4103 | { |
| 4104 | if (row >= 0 && row < mElements.size()) |
| 4105 | { |
| 4106 | if (column >= 0 && column < mElements.first().size()) |
| 4107 | { |
| 4108 | if (QCPLayoutElement *result = mElements.at(row).at(column)) |
| 4109 | return result; |
| 4110 | else |
| 4111 | qDebug() << Q_FUNC_INFO << "Requested cell is empty. Row:" << row << "Column:" << column; |
| 4112 | } else |
| 4113 | qDebug() << Q_FUNC_INFO << "Invalid column. Row:" << row << "Column:" << column; |
| 4114 | } else |
| 4115 | qDebug() << Q_FUNC_INFO << "Invalid row. Row:" << row << "Column:" << column; |
| 4116 | return 0; |
| 4117 | } |
| 4118 | |
| 4119 | |
| 4120 | /*! \overload |