| 138 | } |
| 139 | |
| 140 | ModelIndex SortingProxyModel::index( int row, int column, const ModelIndex& parent ) const { |
| 141 | if ( row < 0 || column < 0 ) |
| 142 | return {}; |
| 143 | |
| 144 | auto sourceParent = mapToSource( parent ); |
| 145 | const_cast<SortingProxyModel*>( this )->buildMapping( sourceParent ); |
| 146 | |
| 147 | auto it = mMappings.find( sourceParent ); |
| 148 | eeASSERT( it != mMappings.end() ); |
| 149 | auto& mapping = *it->second; |
| 150 | if ( row >= static_cast<int>( mapping.sourceRows.size() ) || column >= (Int64)columnCount() ) |
| 151 | return {}; |
| 152 | return createIndex( row, column, &mapping ); |
| 153 | } |
| 154 | |
| 155 | ModelIndex SortingProxyModel::parentIndex( const ModelIndex& proxyIndex ) const { |
| 156 | if ( !proxyIndex.isValid() ) |
no test coverage detected