-QItemSelection MappedSelectionModel::mapFromSource(const QItemSelection &sourceSelection) {
- if(isProxyModel()) {
- QItemSelection mappedSelection;
- foreach(QItemSelectionRange range, sourceSelection) {
- QModelIndex topleft = mapFromSource(range.topLeft());
- QModelIndex bottomright = mapFromSource(range.bottomRight());
- if(topleft.isValid() && bottomright.isValid())
- mappedSelection << QItemSelectionRange(topleft, bottomright);
- else
- Q_ASSERT(!topleft.isValid() && !bottomright.isValid());
- }
- return mappedSelection;
- } else {
+QItemSelection MappedSelectionModel::mapSelectionFromSource(const QItemSelection &sourceSelection) {
+ if(isProxyModel())
+ return proxyModel()->mapSelectionFromSource(sourceSelection);
+ else