| 74 | } |
| 75 | |
| 76 | QModelIndex DatasetProxyModel::mapFromSource(const QModelIndex &sourceIndex) const |
| 77 | { |
| 78 | Q_ASSERT_X(sourceModel(), "DatasetProxyModel::mapFromSource", "A source " |
| 79 | "model must be set before the selection can be configured."); |
| 80 | |
| 81 | if (!sourceIndex.isValid()) |
| 82 | return sourceIndex; |
| 83 | |
| 84 | if (mRowSrcToProxyMap.isEmpty() && mColSrcToProxyMap.isEmpty()) { |
| 85 | return createIndex(sourceIndex.row(), sourceIndex.column(), |
| 86 | sourceIndex.internalPointer()); |
| 87 | } else { |
| 88 | int row = mapSourceRowToProxy(sourceIndex.row()); |
| 89 | int column = mapSourceColumnToProxy(sourceIndex.column()); |
| 90 | return createIndex(row, column, sourceIndex.internalPointer()); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | QModelIndex DatasetProxyModel::mapToSource(const QModelIndex &proxyIndex) const |
| 95 | { |
no test coverage detected