| 98 | } |
| 99 | |
| 100 | T data(const QModelIndex &index) const |
| 101 | { |
| 102 | if (!index.isValid() || index.parent() != m_rootIndex || index.row() >= m_model->rowCount(m_rootIndex) || index.column() >= m_model->columnCount(m_rootIndex)) |
| 103 | return ModelDataCachePrivate::nan<T>(); |
| 104 | |
| 105 | if (index.row() >= m_data.count()) { |
| 106 | qWarning("KDChart didn't receive signal rowsInserted, resetModel or layoutChanged, " |
| 107 | "but an index with a row outside of the known bounds."); |
| 108 | |
| 109 | // apparently, data were added behind our back (w/o signals) |
| 110 | const_cast<ModelDataCache<T, ROLE> *>(this)->rowsInserted(m_rootIndex, |
| 111 | m_data.count(), |
| 112 | m_model->rowCount(m_rootIndex) - 1); |
| 113 | Q_ASSERT(index.row() < m_data.count()); |
| 114 | } |
| 115 | |
| 116 | if (index.column() >= m_data.first().count()) { |
| 117 | qWarning("KDChart didn't got signal columnsInserted, resetModel or layoutChanged, " |
| 118 | "but an index with a column outside of the known bounds."); |
| 119 | |
| 120 | // apparently, data were added behind our back (w/o signals) |
| 121 | const_cast<ModelDataCache<T, ROLE> *>(this)->columnsInserted(m_rootIndex, |
| 122 | m_data.first().count(), |
| 123 | m_model->columnCount(m_rootIndex) - 1); |
| 124 | Q_ASSERT(index.column() < m_data.first().count()); |
| 125 | } |
| 126 | |
| 127 | return data(index.row(), index.column()); |
| 128 | } |
| 129 | |
| 130 | T data(int row, int column) const |
| 131 | { |
no test coverage detected