| 43 | }; |
| 44 | |
| 45 | QModelIndex AbstractProxyModel::mapFromSource(const QModelIndex &sourceIndex) const |
| 46 | { |
| 47 | if (!sourceIndex.isValid()) |
| 48 | return QModelIndex(); |
| 49 | // qDebug() << "sourceIndex.model()="<<sourceIndex.model(); |
| 50 | // qDebug() << "model()="<<sourceModel(); |
| 51 | Q_ASSERT(sourceIndex.model() == sourceModel()); |
| 52 | |
| 53 | // Create an index that preserves the internal pointer from the source; |
| 54 | // this way AbstractProxyModel preserves the structure of the source model |
| 55 | return createIndex(sourceIndex.row(), sourceIndex.column(), sourceIndex.internalPointer()); |
| 56 | } |
| 57 | |
| 58 | QModelIndex AbstractProxyModel::mapToSource(const QModelIndex &proxyIndex) const |
| 59 | { |
nothing calls this directly
no test coverage detected