| 37 | } |
| 38 | |
| 39 | QVariant TableModel::data(const QModelIndex &index, int role) const |
| 40 | { |
| 41 | // FIXME kdchart queries (-1, -1) for empty models |
| 42 | if (index.row() == -1 || index.column() == -1) { |
| 43 | qDebug() << "TableModel::data: row:" |
| 44 | << index.row() << ", column:" << index.column() |
| 45 | << ", rowCount:" << rowCount() << ", columnCount:" |
| 46 | << columnCount() << Qt::endl |
| 47 | << "TableModel::data: FIXME fix kdchart views to not query" |
| 48 | " model data for invalid indices!"; |
| 49 | return QVariant(); |
| 50 | } |
| 51 | |
| 52 | /* qDebug () << "TableModel::data: row: "<< index.row() << ", column: " |
| 53 | << index.column() << endl;*/ |
| 54 | Q_ASSERT(index.row() >= 0 && index.row() < rowCount()); |
| 55 | Q_ASSERT(index.column() >= 0 && index.column() < columnCount()); |
| 56 | |
| 57 | if (role == Qt::DisplayRole || role == Qt::EditRole) { |
| 58 | return m_rows[index.row()][index.column()]; |
| 59 | } else { |
| 60 | return QVariant(); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | QVariant TableModel::headerData(int section, Qt::Orientation orientation, int role) const |
| 65 | { |
no test coverage detected